Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 231293

Forum Post: RE: MSP430FR2533: ADC register ADCSC and ADCBUSY bits remain set after initial ADC interrupt

$
0
0
Hi Jacob, One thing I wanted to point out is that I noticed you are turning on the ADC and starting a conversion in the same line: ADCCTL0 |= ADCON | ADCENC | ADCSC; // enable adc We recommend turning on the ADC for at least 100ns before starting a conversion to avoid conversion errors: Here's an example of how we would recommend configuring the ADC and starting a conversion: // Configure ADC10 ADCCTL0 |= ADCSHT_2 | ADCON; // ADCON, S&H=16 ADC clks ADCCTL1 |= ADCSHP; // ADCCLK = MODOSC; sampling timer ADCCTL2 |= ADCRES; // 10-bit conversion results ADCMCTL0 |= ADCINCH_1; // A1 ADC input select; Vref=AVCC ADCIE |= ADCIE0; // Enable ADC conv complete interrupt while(1) { ADCCTL0 |= ADCENC | ADCSC; // Sampling and conversion start __bis_SR_register(LPM0_bits | GIE); // LPM0, ADC_ISR will force exit __no_operation(); // For debug only if (ADC_Result < 0x1FF) P1OUT &= ~BIT0; // Clear P1.0 LED off else P1OUT |= BIT0; // Set P1.0 LED on __delay_cycles(5000); } I would recommend setting the ADCON bit before starting a conversion with the ADCSC bit like the example above. This does not explain why the ADCBUSY and ADCSC bits are staying high, but just wanted to point this out. Digging a bit deeper into the original issue - can you post your updateADCReg(); function code? I would like to see what that function is doing. Also, can you tell me what frequency you are running the CPU at? Thanks! -Mitch

Viewing all articles
Browse latest Browse all 231293

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>