|
|
View previous topic :: View next topic |
Author |
Message |
allenhuffman
Joined: 17 Jun 2019 Posts: 552 Location: Des Moines, Iowa, USA
|
SOLVED: Getting UART over ICSP pins on PIC24EP256GP202 |
Posted: Wed Jul 12, 2023 8:15 am |
|
|
Awhile ago, I posted a topic where I was trying to get a serial port working on a device:
http://www.ccsinfo.com/forum/viewtopic.php?t=59501&highlight=
I am now trying to do the same thing (for the same reason -- a board without UART pins, hijacking the ICSP pins to use for printfs).
On this hardware, the compiler says I cannot use these pins:
Code: | // Use ICSP port pins 5 (B1) as UART RX, and pin 4 (B0) as UART TX
// ICSP Port: 5 4 3 2 1
// B1 B0 G 3V
#pin_select U1TX=PIN_B0
#pin_select U1RX=PIN_B1
#use rs232 (BAUD=115200, UART1) |
I started by copying this over from the working board (different PIC24) and now am trying to figure out if I can even get this going.
I'd be fine even with software bitbanger ports, but I have not used those (assuming they are in CCS somewhere).
Tips? _________________ 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 Wed Jul 12, 2023 10:06 am; edited 1 time in total |
|
|
allenhuffman
Joined: 17 Jun 2019 Posts: 552 Location: Des Moines, Iowa, USA
|
|
Posted: Wed Jul 12, 2023 8:49 am |
|
|
I was able to get software serial working:
Code: | #use rs232 (BAUD=115200, FORCE_SW, XMIT=PIN_B0, RCV=PIN_B1) |
_________________ 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 ? |
|
|
gaugeguy
Joined: 05 Apr 2011 Posts: 303
|
|
Posted: Wed Jul 12, 2023 9:16 am |
|
|
According to the data sheet RB0 is RPI so PPS input only. |
|
|
allenhuffman
Joined: 17 Jun 2019 Posts: 552 Location: Des Moines, Iowa, USA
|
|
Posted: Wed Jul 12, 2023 10:03 am |
|
|
gaugeguy wrote: | According to the data sheet RB0 is RPI so PPS input only. |
Ah ... "/RPI32" -- I must have thought 132 not I-32. Well, then, I guess I'm out of luck with this part.
When I use the ICD80 debugger console, it tends to lock up and scramble data pretty easily.
When using serial, it ran much longer (I got 15,000 lines before it crashed with out of memory). But, too much printing and it also locks up even in Serial Port mode.
I had hoped UART would be faster but I don't have any other free pins to try to hijack.
Thanks for pointing that out. _________________ 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: 1345
|
|
Posted: Wed Jul 12, 2023 6:56 pm |
|
|
allenhuffman wrote: | I was able to get software serial working:
Code: | #use rs232 (BAUD=115200, FORCE_SW, XMIT=PIN_B0, RCV=PIN_B1) |
|
Because it is a software UART, you should also add DISABLE_INTS to your options to avoid garbling of the messages |
|
|
|
|
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
|