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

[SOLVED]#use rs232(ICD,...) debugger printfs on 24EP256GP202

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
allenhuffman



Joined: 17 Jun 2019
Posts: 537
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

[SOLVED]#use rs232(ICD,...) debugger printfs on 24EP256GP202
PostPosted: Tue Aug 20, 2019 10:24 am     Reply with quote

I am now trying to get debug printfs working on another board. This one uses the PIC24EP256GP202.

Using the same #use rs232(ICD) that works on another board (and the Explorer), I get no output. (Serial I/O Monitor opens, but nothing happens.) I expect it is a config difference on this board.

As far as I can tell from the schematics, the ICSP is wired to:

1 - MCLR
2 - 3V
3 - GND
4 - PGED1 (RB3)
5 - PGEC1 (RB2)

I tried

#use rs232(ICD,XMIT=PIN_B2,RCV=PIN_B3)
and
#use rs232(ICD,XMIT=PIN_B3,RCV=PIN_B2)

...with no results. The board that works is using B0 and B1, and it works without specifying XMIT or RCV.

Are there other things that might need to be done to get debug output running?

Thanks!
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?


Last edited by allenhuffman on Tue Aug 20, 2019 11:28 am; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 20, 2019 11:22 am     Reply with quote

What is the other board ? If it's manufactured, tell us the manufacturer
and the name, model or part number.
allenhuffman



Joined: 17 Jun 2019
Posts: 537
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Aug 20, 2019 11:26 am     Reply with quote

PCM programmer wrote:
What is the other board ? If it's manufactured, tell us the manufacturer
and the name, model or part number.


Designed by us, manufactured for us Smile

Turns out, there was a typo in the schematic. Once I figured that out, and confirmed with the hardware group, I was able to get it working:

Code:

/*
1 - MCLR
2 - 3V
3 - GND
4 - PGED3 (RB0)
5 - PGEC3 (RB1)
*/
#use rs232(ICD,XMIT=PIN_B0,RCV=PIN_B1)


Thanks!
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
niels_J



Joined: 16 Nov 2012
Posts: 2

View user's profile Send private message

PostPosted: Tue Mar 10, 2020 10:06 am     Reply with quote

Some more gotchas:
I carefully read this and other topics like:
http://www.ccsinfo.com/forum/viewtopic.php?p=225091
https://www.ccsinfo.com/forum/viewtopic.php?t=56988
http://www.ccsinfo.com/forum/viewtopic.php?p=225064
https://www.youtube.com/watch?v=EnSazS39MeA
http://www.ccsinfo.com/forum/viewtopic.php?p=143276
https://www.ccsinfo.com/forum/viewtopic.php?p=223256
but still couldn't get it working.

What I have found out:
1. ccsloader works as telnet server. I had the telnetservice in windows running, which interfered. After disabling this service the siow window poped up without errors but there were no data communication.

2. My device is PIC16F18855 with pin-select. I added:
Code:
#pin_select NULL=PIN_B6   
#pin_select NULL=PIN_B7
#use RS232(ICD, DISABLE_INTS, xmit=PIN_B7, rcv=PIN_B6)

Explicit xmit and rcv seems to be necessary despite being the default.

Now data from the device is showing as expected except for frequent data errors. This must be due to timing mismatch between device and ICD. I use the internal clock which is not very accurate.

I hope this will help other which are struggling with this problem.

Using a hardware port is far more useful for debugging. Connect it to an ftdi usb/serial converter. These devices support non-standard fine-grained baud rates which can be used to compensate for an inaccurate internal clock.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion 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