View previous topic :: View next topic |
Author |
Message |
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
printf to debugger fails if there is a stream Statement |
Posted: Sat Apr 28, 2007 12:41 pm |
|
|
Code: | #use delay(clock=8000000)
#use rs232(STREAM=BOBII,PARITY=N,BITS=8,BAUD=9600,XMIT=PIN_C6,RCV=PIN_C7)
#use rs232(debugger) |
this will fail
fprintf(BOBII," hello");
printf("hello"); ...... will not print in monitor window
placing the corrsponding #use rs232 statements just before each printf or fprintf will work but is there a better way? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu May 10, 2007 10:42 am |
|
|
What if you declare the debugger UART as a stream ? In other words,
instead of using the special CCS name of "debugger", just declare the
soft UART on pin B3 in the same way as you would declare any stream.
Then use it with normal fprintf() statements. My guess is that this
would solve the problem. |
|
|
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
|
Posted: Thu May 10, 2007 6:23 pm |
|
|
Yes PCM programmer had a better idea and now fprintf(DEBUGGER,"hello");
will work. The baud rate must be 2400 see below
Code: | #use rs232(STREAM=DEBUGGER,PARITY=N,BITS=8,BAUD=2400,XMIT=PIN_B3,RCV=PIN_B3) |
|
|
|
|