Hi, After receiving a command on the serial port I want to disable all interrupts and then wait for the serial port to receive a byte. The following code shows what I am doing.
IEN = 0 ; _nop_() ; _nop_() ; while( !S0RIR ) ; rxbyte = ( uint8_t ) S0TBUF ; S0RIR = 0 ;
Well, without an in-circuit debugger you can never be sure what's going on. Besides, hardware problems is always a possibility (floating NMI pin, for example.) Set up debugging with Monitor166. Even if there is no external RAM in your target hardware, you should be able to debug small pieces of code with 6Kbyte of XRAM. Good luck! - mike
Servicing my non-running watchdog timer means that the code now works fine.
while( !S0RIR ) { _srvwdt_() ; } rx_char = ( uint8_t ) S0RBUF ; S0RIR = 0 ;
The watchdog timer is running unless you stop it before an EINIT or SRVWDT instruction. Sauli