Monitoring Data Coming Into DMA in Real Time

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
BeS__284136
Level 3
Level 3
5 sign-ins 10 replies posted 5 replies posted

I have a shunt monitor using an A7840 isolating amplifier to monitor the current of a DC load.

   

I want the Sigma Delta data converter to double as a device that records current and acts as a circuit breaker.

   

Currently, I have the Sigma Delta putting the current (amps) samples into memory using the DMA. When the numbers exceed a certain value, I want an interrupt to fire triggering a GPIO flag that will light an LED. The interrupt will also remove current from the load.

   

What is the best way to code this? I could use a comparator but I am using the A7840 which has a small offset that I am using code to calibrate out. Also, its output is differential. For optimum accuracy, I think code is the best way, unless someone has another idea.

0 Likes
5 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

If the sample rate relatively low use an ISR that looks at each sample

   

and trigger code based on your breaker condition.

   

 

   

You could also use DMA to place sample in a control reg(s) and use compare logic

   

to issue a HW breaker.

   

 

   

Regards, Dana.

0 Likes

The control registers are 8 bits. 16 bits is coming from the ADC. How do you merge the two together, pull data from the DMA and connect two control registers to a comparator block?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Maybe I miss something here, but: the values that the ADC delivers to the DMA are not software-corrected. So that means you will have the same offset there as you would have  with a comparator.

   

Why don't you use a comparator, and provide its trigger level via a DAC? That way you can correct the offset it in software too...

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

And as a side-note: on the PSoC4 you could use the Sequencing SAR which has a limit-detection feature.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

He is using PSOC 5LP, Seq SAR limited to 12 bits.

   

 

   

Here are some ap notes on A/D (and other) using DMA, AN61102 in particular.

   

 

   

http://www.cypress.com/documentation/application-notes/an52705-psoc-3-and-psoc-5lp-getting-started-d...                                             AN52705     Getting Started with DMA

   

http://www.cypress.com/documentation/application-notes/an84810-psoc-3-and-psoc-5lp-advanced-dma-topi...                          AN84810     PSoC® 3 and PSoC 5LP Advanced DMA Topics

   

http://www.cypress.com/documentation/application-notes/an61102-psoc-3-and-psoc-5lp-adc-data-bufferin...                AN61102 PSoC® 3 and PSoC 5LP - ADC Data Buffering Using DMA

   

http://video.cypress.com/video-library/search/dma/     Videos on DMA

   

https://www.youtube.com/results?search_query=dma+psoc Videos on DMA (some overlap)

   

 

   

Regards, Dana.

0 Likes