Teensy 3.5 as a data logger from two different serial sources?

Status
Not open for further replies.

tgomez

Member
I have a couple devices that have serial out for data. One has a baud rate of 38400 maximum and the other needs to run at 921600 minimum. Serial data is coming in in ~10hz chunks and are asynchronous between the two sources.

1) Can the Teensy 3.5 have two different baud rates set for the serial in simultaneously (different serial inputs on teensy)?
2) Am I able to log both data streams in two separate files on the SD card or can the teensy only have one file open at a time?
I'd be using the MAX3323 chip to convert from RS232 sources to the 3.5's TTL signals.

I've used the teensy for analog datalogging to the SD before but this new situation is more complex.
 
If using two UART pin sets, each/all UARTS have unique individually settable baud rate.

Not noted how much data comes in on each stream?

First guess: Alternating between the two each at 10Hz for small amounts will likely incur some SD time overhead. Seems it would be better to buffer one and write the other in turn perhaps in 512B blocks?

A file not closed is asking for data loss, so open , write, close will see that data survive and work with one file open at a time.
 
I would make sure that you use Serial1 and Serial2 as they have the 8-byte transmit and receive FIFOs and that will reduce the receive interrupt overhead.

There's no real need to go through the Open, write, Close sequence when a simple flush() on the open file will guarantee that the file directory is updated. Still, the flush() call is going to incur some overhead of its own. I think you should consider a buffering scheme with 512-byte or larger blocks.

Have you tested the Max3323 at 921KBPS? The data sheet doesn't guarantee anything beyond 250KBPS. The receivers may function at the higher rate, but you may have problems transmitting if you have to send a lot of data.
 
Status
Not open for further replies.
Back
Top