Page 1 of 1

Selecting alt serial pins? (rogers core)

Posted: Sun May 03, 2020 11:39 am
by Mangy_Dog
Sorry for the repost, (posted this on the backup forum)

But my current project is using a few serial lines, and im filling up my other IOs...

The serial 1 had an alt set of pins for hardware serial. How do I switch which pins serial 1 uses in rogers core? If I can use these alt pins iw ould save me a right headache.

Re: Selecting alt serial pins? (rogers core)

Posted: Sun May 03, 2020 12:43 pm
by stevestrong
Two options:
1) - change the core file HardwareSerial.cpp lines to adapt the new pins from the board.h
2) - declare your own new HardwareSerial name(USART<?>n, <new_TX_PIN>, <new_RX_PIN>) in your sketch.

In both cases you have to remap the USART pins with afio_remap(<param>), wherein the param is one of these.