Does comparison window work for SAME70 ADC conversion free run?

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using AFEC ADC conversion (SAM E70/V71) in free run mode using a group natural sequence, can a comparison window be used for all the channels and trigger interrupt if any channel value is out of window limits?  If the answer is yes, then can a filter be used for a comparison ? (multiple out-of-window events should trigger the interrupt). The datasheet does not correlate these two modes but it is not clear if the fast speed of a free run conversion can allow enough time for a comparison, especially with filtering.

Such would be a use case where the periodic comparison value is not important for normal operation but ADC in free run is only used to watch for the out-of-limits sensor values.

Please advice if it is possible.

 

Last Edited: Wed. Mar 4, 2020 - 03:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After much of work I got the answer: yes it works in a free run mode.

I use AFEC Async driver. I set the interrupt to trigger only for the out-of-window limits breach and my callback processes the event by reading the AFEC.CDR register using the async  API for reading a specific channel CDR. After the reading from CDR, interrupt flag clears.

I do not set the AFEC driver to trigger the "conversion end" interrupt. Therefore in my application this setup only watches for the over-current event without taking time of CPU to read every conversion result. Very efficient.

Beware though: you have to setup such a clock divider giving enough time for the conversion of all the channels.