If the number of buffers for Event Group is 16,and I write 18 conversion results into memory in continuous conversion mode,so how many results can I read through ADEVBUFFER register?Thank you.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
If the number of buffers for Event Group is 16,and I write 18 conversion results into memory in continuous conversion mode,so how many results can I read through ADEVBUFFER register?Thank you.
Hi,
When the memory is full (16 buffers):
if the OVR_RAM_IGN bit in ADEVMODECR register is set, the ADC module ignores the contents of the group’s results’ memory and overwrite the memory with the results of new conversions. then you can read 16 conversion results: from 3rd to 18th
If the OVR_RAM_IGN bit is not set, then your code has to read out the group’s results’ memory upon an overrun condition; only then can the ADC continue to write new results to the memory. This means you have to read out the first 16 conversion results, then 2.
Hello QJ Wang,
If the OVR_RAM_IGN bit is not set,when an overrun of the memory occurs,is the conversion continuing or stopping? If the conversion still work,will the new results be lost when I'm reading the first 16 conversion results?Thank you.
Hello Gunxiong,
If a conversion group is configured to be in a continuous conversion mode, then it needs to only be triggered once. All the channels selected for conversion in that group will be converted repeatedly.
You can enable Group Memory Threshold Interrupt, and read the conversion result in the interrupt service routine.
If OVR_RAM_IGN bit is not set, the ADC cannot overwrite the contents of the Event Group results memory. When an overrun of this memory occurs, the software needs to read out all the contents of this memory before the ADC is able to write a new conversion result for the Event Group. If contents in the conversion memory is not read-out, the new conversion results will be lost.
Hi QJ Wang,
If the memory is full (16 buffers),and I read out all the 16 results,then I read it for the 17th time,I know the empty flag will be setted,I want to know what is the value of the id and data field?Is it still the content of the 16th buffer or an unknown content?
Thanks.
Once all available conversion results have been read out of the FIFO by the application, a subsequent read from the FIFO causes the mechanism to indicate that the FIFO is empty by setting the EMPTY field. A result that is read from the memory in this method is removed from the memory.
Hi QJ Wang,
for below document claim the software need read out all the contents. this means read out in FIFO queue or read out from memory directly?
Yes. If OVR_RAM_IGN is cleared (=0), your code has to read out the conversion results, otherwise the new conversion results are discarded.