Hi,
I need to understand few things with this example.
How do I get a 1.2ms period (see comment) with this configuration :
I can read In the RM : Counting uses : (peripheral clock)/(MULT x PRESCALAR)
Here we got 80MHz / (40*128) = 15625 and PDB0->MOD = 14400 so I got a 1,085Hz freq .
Do I get something wrong with this ?
While debugging, I can see that I need more than 1.2ms ton reenter in my interruption but if I comment the line ADC_result = ADC0->R[0]; I reenter in my interruption without delay. Do the reading clear any flag ?
ISR code :
Thanks for your answers,
Florian
Solved! Go to Solution.
Hi,
your calculation is correct and you confirmed it by measurement you did.
Unfortunately example description here is wrong.
You need to read ADC result register to clear COCO flag. An interrupt is generated if the respective SC1n[AIEN] and SC1n[COCO] are set.
BR, Petr
Hi,
your calculation is correct and you confirmed it by measurement you did.
Unfortunately example description here is wrong.
You need to read ADC result register to clear COCO flag. An interrupt is generated if the respective SC1n[AIEN] and SC1n[COCO] are set.
BR, Petr
I just put this piece of code in the ADC ISR :
PTB-> PTOR |= 1 << 17; // Toggle
And this is what I see with my scope :
I have the 1,09 Hz freq I calculated ...
When I open the project in SDK example it says :
Period = 9ms
Then in the code comment :
But I can see on my scope 0,91s period.
Which one of those periods is the correct one ?
Thanks