Serial Rx Only

Status
Not open for further replies.

capricorn one

Well-known member
Wondering if it's possible to use only the Rx or Tx pin of the Serial port ( specifically on pin 8, Serial3, of Teensy 3.1/3.2 ). I'm using the Audio adapter board which remaps the SPI mosi pin to pin 7, which is the Rx pin of Serial3. I would like to be able to still use the hardware Serial3 port though at the same time, with pin 8 as Serial3 Tx pin, and pin 7 as SPI Mosi pin. Anyone ever try this? I know it would be a low level io pin remapping, but just wondering if the hardware is capable of doing this at all. Thanks in advance!
 
Last edited:
I would like to be able to still use the hardware Serial3 port though at the same time, with pin 8 as Serial3 Tx pin, and pin 7 as SPI Mosi pin. Anyone ever try this?

Yes. In fact, I did this just a couple weeks ago. Here's the working code:

https://github.com/PaulStoffregen/SOAK2016/blob/master/controller/controller.ino#L176

All you need to do is use Serial3.begin(baud) before SPI.setMOSI(7) & SD.begin(pin). Pins 7 and 8 get configured for Serial3. Then SD.begin() steals pin 7 for MOSI, but pin 8 continues to work as Serial3 transmit. Obviously you can't use Serial3 to receive like this, but you can send. That project uses Serial3 to send messages to a motor controller which vibrates a 20 foot tall structure.... to add dramatic effect to sounds played on little speakers.
 
Awesome, thanks Paul!

After some digging and rethinking, I realized I really need the Rx as well. Was about to look for some kind of SPI->UART converter chip, which I wanted to avoid, when I realized that just like the UART pins, a lot of the core functionality of the MK20DX is able to be remapped to different IO pins. So, unless I'm wrong, I think I can move the I2S0_MCLK from pin 11 (MK20 pin 51) to pin 28 (MK20 pin 53) according to the signal multiplexing page in the datasheet. This gives me back access to pin 7 for UART2_RX. I'm guessing you didn't do this on the audio adapter board because pin 28 is on the underside connections, not the standard header pins?

Thanks for your help Paul!
 
Status
Not open for further replies.
Back
Top