question about serial ports

Status
Not open for further replies.

caldersm

Member
I didn't see where this was asked before, so forgive me if it has been.

I have a Teensy3.1, and I see it has 24 I/O pins. I need 23 I/O pins as outputs to represent a 23 bit BCD code, and also need to receive serial ASCII characters. I know I can use a breakout board, but I am trying to do it with the native 28 pins that are soldered already.

Can I use the Pin 0 Rx1 to receive the data, and then use Pin 1 as an output for another purpose...? Or will using the serial port mess up using TX1 pin 1 as just a regular output.

And if so, do I need to change something in my code to block it from trying to transmit on that pin...?

I absolutely love the Teensy 3.1....amazing chip for sure..!!

Thanks so much for your help...!!

Steve
 
I didn't see where this was asked before, so forgive me if it has been.

I have a Teensy3.1, and I see it has 24 I/O pins. I need 23 I/O pins as outputs to represent a 23 bit BCD code, and also need to receive serial ASCII characters. I know I can use a breakout board, but I am trying to do it with the native 28 pins that are soldered already.

Can I use the Pin 0 Rx1 to receive the data, and then use Pin 1 as an output for another purpose...? Or will using the serial port mess up using TX1 pin 1 as just a regular output.

And if so, do I need to change something in my code to block it from trying to transmit on that pin...?

I absolutely love the Teensy 3.1....amazing chip for sure..!!

Thanks so much for your help...!!

Steve

Any help here...? Paul, can you answer this question...? I need to submit an RFQ, and I am trying to get this answered, before the end of the day today....

Thanks so much again for any help you can provide..
 
Any help here...? Paul, can you answer this question...? I need to submit an RFQ, and I am trying to get this answered, before the end of the day today....

Woah, ok, I'm here. Do you realize only about 16 hours (most of them not regular business hours) elapsed between your two questions?

And yes, to make this work, all you have to do is use Serial1.begin(9600) and then pinMode(1, OUPTUT) after the serial port is running, to reclaim the pin as a normal digital output. This trick only works on Teensy 3.x. The older AVR chips reassign pins differently.
 
Well , Paul told you how to do it so my question is moot, but it's not that hard to bit bang serial at reasonable baud rates.

Ira
 
Am so sorry Paul....I know you are busy. Thank you so much..!! I try to never take advantage of people's time.

I want to use the Teensy 3.1, because I find it superior to the AVR chipsets. I have a demo working using an attiny85 with MCP23017 I/O expanders, but the teensy makes it a much more elegant solution. Was trying to give back some love for your creation....it is amazing..!!

I just finished another modification using a 3.1 that monitors the "pick" on a Loom machine....recording travel time down to 1 microsecond....while display information on an LCD and reported the collected data out the serial port to a PC.....all in a $20 chip. Everyone is astounded at its capabilities.

Just wanted to show my appreciation by moving this project forward using the Teensy.

Thanks for the quick response...will be ordering 20 more in a few weeks.

Steve
 
Status
Not open for further replies.
Back
Top