In ADC peripheral for S32K1xx MCU's, there are ADC Status and Control Register 1 (SC1A - aSC1P). Onto which ADC channel number and its conversion complete status is represented by bits ADCH and COCO.
Now COCO bit is set 1, when ADC conversion of channel reprsented by ADCH bits is completed.
And COCO bit is set to 0, only when respective Result register of channel ADCH is read( Registers RA-RP) or when respective SC1n register is written.
But, in my demo. ADC channel COCO bits does get set and ADC IRQ is invoked, but when i step into my IRQ handler to debug it. My COCO bit is getting cleared on its own. Why is it sooo???
You can see below figure:
IRQ is hit and COCO bit is 1
But as i step into Interrupt, COCO bit gets cleared automatically. Without reading any Result register or I have not performed any write operation on SC1n register.
As a result IRQ does not callback notification function at line 1103. Because IRQ checks the COCO bit of SC1n registers to check which channel is interrupted.
COCO bit of SC1n register of ADC peripheral is getting cleared onb its own without reading any result register or performing any write operation on SC1n registers.
Why is it soo??? Is their something wrong mentioned in datasheet? or somerthing wrong in ADC IRQ handler??
已解决! 转到解答。
Okay great, though i was not reading any result register. But i was reading multiple variables and have set inbetween breakpoints.
But when i remove those breakpoints and variables, its starts working as expected.
But have got one more dout. I want to use PDB Channel Delay feature. /but am not able to get from where to enable ADC Delay Next PDB, in GUI.
I checked on ADC UM manual of S32K1xx, this feature is supported on it. But i cant find from where to enable this feature.