Teensy 3.2 Serial comms at 1.5Mbps

Status
Not open for further replies.

TimSco

Member
Hi All,

I want to intercept an RS422 comm at 1.5Mbps, and decode it on the Teensy. In the process of working out how to convert to TTL serial, but I understand that.

What I'm not sure about is the 1.5Mbps.. is that too fast for Teensy 3.2?

Would that be a Baud of 150000?

Thanks,
 
I think others have gotten 4mpbs using Serial1 (pins 0/1), and enabling CTS (clear to send) and RTS (request to send). Note, CTS must be pin 18/A4 or 20/A6 for Serial1.

CTS/RTS are hardware flow control where the receiving hardware can say whether it is ready to receive data. I seem to recall that the library only provides CTS/RTS on Serial1, and not on Serial2 or Serial3, but perhaps that has been fixed:

Serial1 and Serial2 both have hardware FIFO buffers, which also helps when receiving data.
 
I've tested two T32s tied together directly using Serial1 and was able to get 4.5Mbps without using CTS/RTS. However, the 32 byte packets were sent where each T32 had nothing else to do but this particular task. When they were put into the system, remote controlled phased array sonar boat, the rate had to be dropped to 2.25Mbps and still not using CTS/RTS. The first link is from the shore station unit to the laptop. There is another link in the boat connecting the controller T32 with two others collecting echo data. Previous handshake tests failed because the wrong pin was used for CTS, recently discovered.

I would recommend using the handshake method then push it to the reliable limit.
 
Teensy 3.2 running at 96Mhz can handle 6MBit without flow control, as long as you process the incoming data fast enough.

Serial1 and Serial2 have 8-byte hardware FIFOs. An interrupt is triggered when they are half full. The interrupt handler transfers the data into a RAM buffer that's 64 bytes by default (can easily be increased). As long as there is no mis-behaved code that disables interrupts for a long time, there is no issue with FIFO overflow.
 
Teensy 3.2 running at 96Mhz can handle 6MBit without flow control, as long as you process the incoming data fast enough.

Serial1 and Serial2 have 8-byte hardware FIFOs. An interrupt is triggered when they are half full. The interrupt handler transfers the data into a RAM buffer that's 64 bytes by default (can easily be increased). As long as there is no mis-behaved code that disables interrupts for a long time, there is no issue with FIFO overflow.


Thanks for the responses everyone, looks like I'll be OK in terms of Data rate, If I could bring up another topic of discussion:

I'm trying to find a module to convert to TTL serial.

Sparkfun have this RS485 breakout:
https://www.sparkfun.com/products/10124

This board has an SP3485 rs422/rs485 transceiver. But the module is wired for RS-485? RTS is connected to both lines, instead of having the two differential pairs of RS422 that I want to connect. Can I get this to work for me?
I only need to receive data to teensy.

I'm having difficulty finding an RS422 module with the 4 terminals, that isn't going take a month to get to me (Montreal).

Thanks again,
 
That SP3485 is perfectly adequate. Just wire up your RS422 to A / B and enable the receiver.

If you wanted to transmit data, you could just use 2 of them, one as transmitter and one as receiver.
 
That SP3485 is perfectly adequate. Just wire up your RS422 to A / B and enable the receiver.

If you wanted to transmit data, you could just use 2 of them, one as transmitter and one as receiver.

Thanks tni, that makes sense
 
Status
Not open for further replies.
Back
Top