Hi,
Take the following example to describe the problems we encountered:
ADC Initialization function Key register configuration: (The sampling channel is normally enabled)
pADC_0->CALBISTREG.R = 0xC03706F0U;
pADC_0->MCR.R = 0x00000001U;
pADC_0->MCR.R = 0x80020100U;
pADC_0->CTR0.R = 0x00000016U;
pADC_0->CTR1.R = 0x00000016U;
CTU Initialization function Key register configuration:
pCTU_0->TGSISR.R = 0x00000001u;
pCTU_0->TGSCR.R = 0x0100u;
pCTU_0->TCR[0].R = 0xC8u;
pCTU_0->TCR[1].R = 0x2A8u;
pCTU_0->TGSCCR.R = 0x7fffu;
pCTU_0->CLCR1.R = 0x00000300u;
pCTU_0->THCR1.R = 0x00006161u;
pCTU_0->CLR[0].B.R = 0x20C8u;
pCTU_0->CLR[1].B.R = 0x206Eu;
pCTU_0->CLR[2].B.R = 0x6000u;
pCTU_0->CLR[3].B.R = 0x20C8u;
pCTU_0->CLR[4].B.R = 0x6000u;
pCTU_0->FTH.R =0x00000005u;
pCTU_0->COTR.R = 0x0000u;
pCTU_0->CR.R = 0x00000011u;
The above is a simple initialization configuration for the registers of the two modules
Trigger0 is set to 1.25us, and trigger1 is set to 4.25us, with a difference of 3us.
Refer to chapter 36.5.11 Conversion time in UM for the calculation formula of sample Conversion time
• CALBISTREG[OPMODE] = 000b; CTRx[INPSAMP] = 22d; CTU triggered:
• Single/First Conversion: 2 + 22 + ((13 + 1) × 4) + 2 = 2 + 22 + 56 + 2 = 82cycles of AD_clk
• Subsequent/continuous conversion: 1 + 22 + ((13 + 1) × 4) + 2 =1 + 22 + 56 + 2 = 81 cycles of AD_clk
The conversion time required to sample two ADC command lists is 82+81 ADC CLKS = 2.0375us
When the trigger is designed above, the time interval is 3us. If calculated according to the time provided in UM, ADC_OE error will not be reported, but actually ADC_OE error will be reported. The ADC_OE error will not be reported When trigger1 time is greater than 5.7us.So the question is right here, why did the design report error according to the instructions given by UM?