View previous topic :: View next topic |
Author |
Message |
SeeCwriter
Joined: 18 Nov 2013 Posts: 160
|
rs232 icd |
Posted: Fri Jul 26, 2019 9:34 am |
|
|
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
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9232 Location: Greensville,Ontario
|
|
Posted: Fri Jul 26, 2019 10:36 am |
|
|
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
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9232 Location: Greensville,Ontario
|
|
Posted: Fri Jul 26, 2019 2:21 pm |
|
|
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
|
|
Posted: Fri Jul 26, 2019 3:31 pm |
|
|
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
|
|
Posted: Fri Jul 26, 2019 4:52 pm |
|
|
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
|
|
Posted: Fri Jul 26, 2019 6:26 pm |
|
|
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
|
|
Posted: Fri Jul 26, 2019 6:51 pm |
|
|
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:
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
|
|
Posted: Tue Jul 30, 2019 7:22 am |
|
|
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 ? |
|
|
|