We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
This code fragment is never reached on the MCB2300 board:
UARTInit(9600); /* baud rate setting */ charToSend = 0x55; for ( ;; ) { charToSend = 0x55; UARTSend( (BYTE *)&charToSend, 1 ); #if 0 charToSend = '1'; UARTSend( (BYTE *)&charToSend, 1 ); #endif for (j = 0; j < 100000; j++) ; }
It works fine by removing either: 1) first charToSend line 2) #if 0 and #endif lines E.g.,
UARTInit(9600); /* baud rate setting */ for ( ;; ) { charToSend = 0x55; UARTSend( (BYTE *)&charToSend, 1 ); #if 0 charToSend = '1'; UARTSend( (BYTE *)&charToSend, 1 ); #endif for (j = 0; j < 100000; j++) ; }
or....
UARTInit(9600); /* baud rate setting */ charToSend = 0x55; for ( ;; ) { charToSend = 0x55; UARTSend( (BYTE *)&charToSend, 1 ); charToSend = '1'; UARTSend( (BYTE *)&charToSend, 1 ); for (j = 0; j < 100000; j++) ; }
Have you looked at the generated code to see what's happening?
Jon