Hi all,
I am having a strange issue where it seems that my infinite while loop is not executing properly but ISRs are triggering. I know this because I have a UART trace which dumps variables to a terminal. I increment these variables in infinite loop as well as various ISRs. The ones in ISRs constantly change while the ones in while loop stop after a short duration. I am not using any low power mode. Also, I am getting this problem intermittently and happens only at bootup. If the bootup sequence is complete the code runs fine.
It seems to me that the code is either stuck in some kind of a trap ISR or a default handler. The trap ISR is written in ASM. How do I go about incrementing variables in this trap function so that I can request trace?
Here's the skeleton of my code.
main() { init_hw(); __bis_SR_register(GIE); while(1) { /*code/* } } timer_isr() { code; } ADC_isr() { code; } UART_isr() { REQUEST_TRACE: TRANSMIT VARIABLES THROUGH UART; }
What are the possibilities by which the code is not executing infinite while loop in main and what is the easiest way to debug without using the debugger?
Thanks!