Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

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

  1. #1
    Junior Member
    Join Date
    Apr 2021
    Posts
    1

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

    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.

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,951
    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.

  3. #3
    Senior Member
    Join Date
    Feb 2018
    Location
    Corvallis, OR
    Posts
    334
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •