cancel
Showing results for 
Search instead for 
Did you mean: 

ADC not triggering ISR after each EOC

JDaniel1
Associate II

Hello st forum,

I'm currently working with STM32G0B1VCI6, I'm trying to configure the ADC1 channel but it is not working properly. I need to convert 11 channels (10 external and 1 internal channel) and I'm configuring the driver in such a way it can convert all channels at once. According to the documentation, when sequencer is set to not fully configurable, the conversion is done for the enabled channels using their defined channel ID. My plan is to catch each ECO event to save the data until detect the last element (EOS event). However, I'm getting the interrupt immediately with the EOS flag enabled, causing to just read one data instead of 11. This is the configuration I'm using: 

JDaniel1_0-1741809693267.png

@Roger SHIVELY 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Probably all 11 channels are being converted before you can read the first one out and the data is overwritten. Each conversion here takes about 10 ADC clock cycles. The ADC does not wait for you to read out data before it moves on to convert the next channel.

Increasing sampling time to max can help this, but may not solve it if the code is slow enough.

Using DMA to convert multiple channels is the usual and better method.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

Probably all 11 channels are being converted before you can read the first one out and the data is overwritten. Each conversion here takes about 10 ADC clock cycles. The ADC does not wait for you to read out data before it moves on to convert the next channel.

Increasing sampling time to max can help this, but may not solve it if the code is slow enough.

Using DMA to convert multiple channels is the usual and better method.

If you feel a post has answered your question, please click "Accept as Solution".
JDaniel1
Associate II

The documentation mention that an interrupt is generated after each EOC, makes more sense that ADC is so fast that there is no time to trigger independent EOC. DMA works, I just wanted to double check if this behavior with the interrupts is expected. Thanks for the reply.