|
|
View previous topic :: View next topic |
Author |
Message |
Herbert
Joined: 20 Jul 2008 Posts: 32 Location: Brisbane, Australia
|
Userstream - what does it do? |
Posted: Mon May 31, 2010 3:19 pm |
|
|
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
|
|
Posted: Thu Jun 03, 2010 5:00 pm |
|
|
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
|
|
Posted: Fri Jun 04, 2010 3:11 am |
|
|
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
|
|
Posted: Tue Jun 15, 2010 3:48 pm |
|
|
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) |
|
|
|
|
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
|