Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: MSP430G2553 launchpad using TimerA0, Timer A1, and ADC

$
0
0
The most succinct description of A0 vs A1_VECTOR is SLAU144J sec 12.2.6, but I think you've already figured it out right. There are a number of commented lines, and I'm not quite sure which ones are required to trigger your symptom. Even so, I don't see anything obviously wrong. Here's a shot in the dark: Precede each of your ADC starts ("ADC10CTL0 |= ENC + ADC10SC;") with "__disable_interrupt();". You'll be turning GIE back on two lines below, so you won't stay disabled for very long. Hypothesis: The conversion takes (16+13=29) ADC10CLKs, but ADC10OSC runs at about 5MHz, so that's only about 6usec. With MCLK=~1MHz, that's only 6 CPU clocks, which is one or two instructions. If the Timer1 interrupt happens right then, it could add maybe 40 CPU clocks in between those two lines, and the ADC interrupt would come in before you go to sleep. Since your (only) wakeup source has already triggered, your program would then sleep forever. I can't say that this is what is happening to you, but it is possible, and I've seen stranger things. (It's also a pretty quick experiment.)

Viewing all articles
Browse latest Browse all 62309

Trending Articles



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