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

rs232 icd

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



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

rs232 icd
PostPosted: Fri Jul 26, 2019 9:34 am     Reply with quote

I guess I'm not understanding how #use rs232(icd) works. I thought it would send printf strings to the ICD debugger instead of the STDOUT serial port.
But the compiler complains that rs232(icd) is not allowed in debug mode.

Could someone explain how to use it, or what it does for you?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jul 26, 2019 10:36 am     Reply with quote

See the following thread which explains it:

ICD U64 data monitoring -
http://www.ccsinfo.com/forum/viewtopic.php?t=56988
temtronic



Joined: 01 Jul 2010
Posts: 9232
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 26, 2019 10:36 am     Reply with quote

hmm, I don't see 'icd' as being an option for #use RS232(....).
DEBUGGER is though...
I'm running an older version of the compiler...

Maybe someone who uses it will chime in soon...

Jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jul 26, 2019 10:39 am     Reply with quote

temtronic, download the latest CCS manual. It's on page 194:
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
temtronic



Joined: 01 Jul 2010
Posts: 9232
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 26, 2019 2:21 pm     Reply with quote

Thanks PCMP, now I'm curious as to how to 'link' it to F11, so it'll automatically open like the other does...

Too many PICs, too many features, too little time.
Jay
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

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

PostPosted: Fri Jul 26, 2019 3:31 pm     Reply with quote

If you can get CCS to send you the latest .chm file you can probably just replace the existing one. Then f11 will open the new one instead. However, I wouldn't want to do that since the manual will not describe the actual version of the compiler you have installed...
jeremiah



Joined: 20 Jul 2010
Posts: 1351

View user's profile Send private message

PostPosted: Fri Jul 26, 2019 4:52 pm     Reply with quote

Just want to add if you plan on using the ICD as a serial port (cannot in debug mode), then you should also add "DISABLE_INTS" to your serial port options:

Code:

#use rs232(ICD,DISABLE_INTS)


It's a software serial port, so interrupts affect it.
temtronic



Joined: 01 Jul 2010
Posts: 9232
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 26, 2019 6:26 pm     Reply with quote

hmm, dluu13 brings up a very valid point....I'd probably try to use some new feature and rack my brains for days thinking, gee I got the correct syntax why doesn't it work?....
That'd only get me more confused than I already am....

Better to live in the past than dream in the future ?
Jay
jeremiah



Joined: 20 Jul 2010
Posts: 1351

View user's profile Send private message

PostPosted: Fri Jul 26, 2019 6:51 pm     Reply with quote

temtronic wrote:
hmm, dluu13 brings up a very valid point....I'd probably try to use some new feature and rack my brains for days thinking , gee I got the correct syntax why doesn't it work?....
That'd only get me more confused than I already am....

better to live in the past than dream in the future ?
Jay


Does it compile or does it just not physically work?

One kind of gotcha is that if you are using it on programming pins that are not PGD1/PGC1, you also have to specify the ICSP port:

Code:
#device ICSP=2


or whichever one you are using

Otherwise, the compiler won't know which pins to do the software serial on.

Also, it works via telnet under the hood, so you need to have their serial terminal software SIOW available. I use it from the IDE version program/run command and also CCSLoad run command, but SIOW is available to both on my machine
allenhuffman



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

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

PostPosted: Tue Jul 30, 2019 7:22 am     Reply with quote

All I had to do was #use rs232(ICD) and then my printfs work when using RUN mode. My hardware does not have the extra pin to allow the debug output to work, so I can either debug (no console), or run (console printfs).

It has been massively useful, though it often hangs and disconnects for me.

Note: Adjust ICSP and delay as needed for your hardware.

Code:
#include <24FJ256GA106.h>
#device ICSP=1
#use delay(crystal=20000000)

#use rs232(ICD)

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES CKSFSM                   //Clock Switching is enabled, fail Safe clock monitor is enabled


Code:

#include <printf.h>

#include <stdio.h>

void main()
{
    printf ("Hello, world!\r\n");

    while (1);
}

_________________
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 ?
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