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 support@ccsinfo.com

Userstream - what does it do?

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



Joined: 20 Jul 2008
Posts: 32
Location: Brisbane, Australia

View user's profile Send private message

Userstream - what does it do?
PostPosted: Mon May 31, 2010 3:19 pm     Reply with quote

Hi, I have inadvertently used pin B3 (userstream pin for the debugger) for my hardware, on a PCB implementation(long story) and I need to connect to my board to do some debugging. I am trying to figure out what options I have in terms of hardware/software mods to deal with this.

I have used the debugger extensively on my test bed and on examination of the debugger setup I see userstream is set to false anyway and B3 hasn't been used. So I presume all the key debugger info goes through pins B6 and B7? Including extracting variable values, setting break points, etc?

If this is the case, it makes it easier to deal with my situation.

Some detail, I am using a Mach X, with PCWH(v4.105) and an 18F2620.

Cheers
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 03, 2010 5:00 pm     Reply with quote

The CCS ICD debuggers optionally can use pin B3 as a software UART
on the target PIC, so you can put printf() statements in your program,
and see the text displayed inside the CCS IDE while your debugging.
This is for your own informational messages, to help you debug your
code.

Normally, you would use this statement to enable the debugger serial
channel:
Code:

#use rs232(debugger)

But you can optionally use a different pin than B3 on your PIC.
To do that, you need to change the statement as shown below.
This will use pin B1 for the debugger serial channel:
Code:

#use rs232(stream=DEBUGGER,baud=2400,xmit=PIN_B1,rcv=PIN_B1)

This page shows the pinout of the ICD connector. It shows which pin
is used for the Debugger serial port communications:
http://www.ccsinfo.com/faq.php?page=icd_connection

If you're also using the hardware UART, then you need to give that
#use rs232() line a "stream" identifier, and then use fprintf() for your
debugger messages (and for the normal UART), and put in DEBUGGER
as the stream in fprintf().
Herbert



Joined: 20 Jul 2008
Posts: 32
Location: Brisbane, Australia

View user's profile Send private message

PostPosted: Fri Jun 04, 2010 3:11 am     Reply with quote

Hi PCM, thanks very much for the info. That very clearly explains what goes on and what the options are. You've done an excellent job, I understand now. Looks like I got away with that mistake, with very little impact. Cheers.
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Tue Jun 15, 2010 3:48 pm     Reply with quote

Code:
#use rs232(debugger,STREAM=MONITOR) //// debug to MONITOR via  pin b3
 fprintf(MONITOR,"****************************\r\n");


I think this is the correct syntax to write to the monitor window in the debugger IDE

I suspect the statement below doesn't work as well as it just defines a new STREAM called DEBUGGER

#use rs232(stream=DEBUGGER,baud=2400,xmit=PIN_B1,rcv=PIN_B1)
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