SPRZ292S December 2008 – November 2020 TMS320F28020 , TMS320F280200 , TMS320F28021 , TMS320F28022 , TMS320F28022-Q1 , TMS320F280220 , TMS320F28023 , TMS320F28023-Q1 , TMS320F280230 , TMS320F28026 , TMS320F28026-Q1 , TMS320F28026F , TMS320F28027 , TMS320F28027-Q1 , TMS320F280270 , TMS320F28027F , TMS320F28027F-Q1
ADC: ADC can Become Non-Responsive When ADCNONOVERLAP or RESET is Written During a Conversion
0, A, B
The ADC can get into a non-responsive state when the ADCCTL2[ADCNONOVERLAP] is modified while a conversion is in progress. When in this condition, no further conversion from the ADC will be possible without a device reset.
There are two different ways to cause this condition:
Follow this sequence to modify ADCCTL2[ADCNONOVERLAP] or write ADCCTL1[RESET]:
An example code follows.
EALLOW;
// Set all SOC trigger sources to software
AdcRegs.ADCSOC0CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC1CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC2CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC3CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC4CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC5CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC6CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC7CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC8CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC9CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC10CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC11CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC12CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC13CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC14CTL.bit. TRIGSEL = 0;
AdcRegs.ADCSOC15CTL.bit. TRIGSEL = 0;
// Set all ADCINTSOCSEL1/2 to 0.
AdcRegs.ADCINTSOCSEL1.bit.SOC0 = 0;
AdcRegs.ADCINTSOCSEL1.bit.SOC1 = 0;
AdcRegs.ADCINTSOCSEL1.bit.SOC2 = 0;
AdcRegs.ADCINTSOCSEL1.bit.SOC3 = 0;
AdcRegs.ADCINTSOCSEL1.bit.SOC4 = 0;
AdcRegs.ADCINTSOCSEL1.bit.SOC5 = 0;
AdcRegs.ADCINTSOCSEL1.bit.SOC6 = 0;
AdcRegs.ADCINTSOCSEL1.bit.SOC7 = 0;
AdcRegs.ADCINTSOCSEL2.bit.SOC8 = 0;
AdcRegs.ADCINTSOCSEL2.bit.SOC9 = 0;
AdcRegs.ADCINTSOCSEL2.bit.SOC10 = 0;
AdcRegs.ADCINTSOCSEL2.bit.SOC11 = 0;
AdcRegs.ADCINTSOCSEL2.bit.SOC12 = 0;
AdcRegs.ADCINTSOCSEL2.bit.SOC13 = 0;
AdcRegs.ADCINTSOCSEL2.bit.SOC14 = 0;
AdcRegs.ADCINTSOCSEL2.bit.SOC15 = 0;
// Ensure there is not another SOC pending
while (AdcRegs.ADCSOCFLG1.all != 0x0);
// Wait for conversions to complete
// Delay time based on ACQPS = 6 , ADCCTL2[CLKDIV2EN] = 1, ADCCTL2[CLKDIV4EN] = 0
// 7 + 13 ADC Clocks = 20 ADCCLKS -> 40 SYSCLKS
asm(" RPT#40||NOP");
// ADCCTL2[ADCNONOVERLAP] = <new value>;
// ADCCTL1[RESET] = 1;
EDIS;