Redefining the UART 1 pins

Post Reply
shebychev
Posts: 7
Joined: Wed May 03, 2017 5:28 pm

Redefining the UART 1 pins

Post by shebychev » Sun May 21, 2017 8:32 pm

Hi everyone,

I'm a bit confused as in an older version of Board_Defs.h in the Chipkit-Core library, there is a definition for the serial0 and serial1 pins, like so:
#define _SER0_TX_OUT PPS_OUT_U1TX // RPB3R = U1TX = 1
#define _SER0_TX_PIN 14 // RB3 AN5/C1INA/C2INC/RTCC/RPB3/SCL2/PMWR/RB3
#define _SER0_RX_IN PPS_IN_U1RX // U1RXR = RPB13 = 3
#define _SER0_RX_PIN 6 // RB13 AN11/RPB13/CTPLS/PMRD/RB13

but in the new version, no such definition exists. In fact, the call to HardwareSerial just doesn't include these definitions. Does anyone have any information as to how these pins are now defined? I'm asking because i wish to switch the _SER0_TX_PIN and the _SER0_RX_PIN values, but it is not having an effect on my board and i'm assuming it's because of this call in HardwareSerial.cpp

#if defined(__PIC32_PPS__)
HardwareSerial Serial((p32_uart *)_SER0_BASE, _SER0_IRQ, _SER0_VECTOR, _SER0_IPL, _SER0_SPL, IntSer0Handler, _SER0_TX_PIN, _SER0_RX_PIN, _SER0_TX_OUT, _SER0_RX_IN);
#else
HardwareSerial Serial((p32_uart *)_SER0_BASE, _SER0_IRQ, _SER0_VECTOR, _SER0_IPL, _SER0_SPL, IntSer0Handler);
#endif

Any information is appreciated. Thanks!

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Redefining the UART 1 pins

Post by majenko » Sun May 21, 2017 9:53 pm

Which board are you on about?
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

shebychev
Posts: 7
Joined: Wed May 03, 2017 5:28 pm

Re: Redefining the UART 1 pins

Post by shebychev » Mon May 22, 2017 4:16 pm

Sorry, I'm using the PIC32MX250F128B

User avatar
majenko
Site Admin
Posts: 2164
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: Redefining the UART 1 pins

Post by majenko » Mon May 22, 2017 4:56 pm

They should be there in your definition then. If they aren't then it wouldn't be able to compile the serial code.

Are you sure you are looking at the right Board_Defs.h file for your board?
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

Post Reply