CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

printf to debugger fails if there is a stream Statement

 
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go
View previous topic :: View next topic  
Author Message
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

printf to debugger fails if there is a stream Statement
PostPosted: Sat Apr 28, 2007 12:41 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu May 10, 2007 10:42 am     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Thu May 10, 2007 6:23 pm     Reply with quote

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)
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group