View previous topic :: View next topic |
Author |
Message |
tripper269
Joined: 06 May 2013 Posts: 33 Location: Toronto
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Feb 23, 2018 5:12 pm |
|
|
Quote: | I tried but couldn't make it. |
I studied this by compiling the following test program and looking at
the .LST file. I didn't test it with an ICD64 in actual operation.
Code: |
#include <18F46K22.h>
#fuses INTRC_IO, NOWDT, BROWNOUT, PUT, NOPBADEN
#use delay(clock=4M)
#use rs232(ICD)
//======================================
void main()
{
printf("Start \n\r");
while(TRUE);
}
|
Conclusions:
1. It uses a software UART (bit-banged).
2. It transmits at 38400 baud.
3. It defaults to transmitting on Pin B7 and receiving on Pin B6.
4. You can change the transmit pin to Pin C6 by doing this:
Code: | #use rs232(ICD, xmit=PIN_C6) |
5. You can change the default receive pin to C7 by doing this:
Code: | #use rs232(ICD, xmit=PIN_C6, rcv=PIN_C7) |
6. Adding the #use rs232(ICD) line causes the compiler to insert a 4.5
second delay at the start of main(). The program won't do anything until
that delay has passed. I verified this delay time with the MPLAB v8.92
simulator's stopwatch feature. |
|
|
allenhuffman
Joined: 17 Jun 2019 Posts: 554 Location: Des Moines, Iowa, USA
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
allenhuffman
Joined: 17 Jun 2019 Posts: 554 Location: Des Moines, Iowa, USA
|
|
Posted: Fri Jul 05, 2019 12:21 pm |
|
|
Fantastic! That helped.
Running it using "Build & Run" did pop up the terminal, which helps.
I have yet to get any output when in Debug mode, though.
At least now I know it works. Thank you so much. _________________ 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 ? |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1354
|
|
Posted: Fri Jul 05, 2019 7:43 pm |
|
|
allenhuffman wrote: |
Fantastic! That helped.
Running it using "Build & Run" did pop up the terminal, which helps.
I have yet to get any output when in Debug mode, though.
At least now I know it works. Thank you so much. |
it won't work in debug mode. It uses the same pins that debug mode does. |
|
|
|