Friends, Russians and Countrymen! I have a problem which is seriously weird. (no, not that one, I've seen the doctor about that).
This doesn't seem to be a GCC bug, so relax.. I have an F148 program in which a fair amount is going on: interrupts for Timer_A0 and Port 2 edge (for a TimerA uart), Timer_A1 CCR1 and CCR2, and receive interrupts for both hardware uarts. All interrupt routines are enablenested, and the right code seems to be generated. So far so good. Now the problem: I am using the ADC in sequence mode, for a sequence of six channels. I've tested this in a standalone program, it's fine. The problem is, when I integrate it with my real program, the TimerA uart hangs. The ADC conversion is called from the CCR1/2 interrupt. CCR2 is the 1ms timebase. The odd part is, that if I jimmy the check for ADC ready test to always return 1, everything works OK (except of course for the ADC). With the ADC test in place, the CCR2 interrupt completes (so the ADC isn't hanging), but the uart runs (sometimes for one or two characters, sometimes for a couple of dozen) then hangs. The ADC ready test (ADC12CTL0 & ADC12SC) seems to produce the right code, and there's nothing else in that routine apart from the pushes and pops. There are no extra pushes compared to when I make the routine return TRUE, so I'm not running out of stack. I'm baffled. Can I put it to your combined almost infinite brain power to come up with an explanation? Regards Paul Burke