Hi all,
I am starting work on a project where I will be using a Teensy LC to act as a USB to Serial converter with a twist: the Teensy LC will need to intercept and tweak communication for the specific application; so it won't be a simple get-send case, but get-parse-send (hence why and FTDI won't do)
The other issue is that we need the lowest possible latency (where FTDI doesn't excel either)
Therefore , for this project to be successful, I need to get the absolute best performance on the USB Serial implementation.
I've used Teensyduino for quite a while now, and on occasion, when I need to tweak a function, I dig into the Arduino libraries and the Processor Datasheet and tweak what I need. (for example, enabling 1 wire communication (i.e. merging RX and TX) on the UART using the LOOPS processor capability)
While doing so, it has become clear that most of the Arduino-style functions (such as Serial.read(), Serial.write(), and many others) are actually encapsulated in separate C files (such as serial.c), which are properly organized in functions.
This brings me to the following questions:
1) Wouldn't it be faster (and less bloated) if I just call the Teensy functions directly, bypassing the Arduino abstraction layer?
1a) In doing so, is there any toolchain or sample where I could start from (including Makefiles)?
1b) I realize that initializing the processor is not a trivial task; It is done by the Teensyduino library but I'm unclear if I can reuse barebones libraries for this; are there any advice pointers for this?
2) There are some published USB benchmark tests at the end of this page https://www.pjrc.com/teensy/usb_serial.html
2a) How do these compare to the current implementation of the stack on the Teensy LC / 3.2?
2b) Were they achieved using a full Teensyduino/Arduino sketch or a lighterweight code as I mention in 1)
3) Finally, any advice on reducing latency?
The biggest enemy we've had with FTDI is really the high latency; we're doing high speed USB-serial (as native Serial ports have practically vanished) and FTDI has several issues with unpredictable timing. Some seem to be on the OS side but others seem to be on the chip's own firmware (cahching, etc).
To be clear: I'm not looking to dig into 100s of pages of the processor or ARM manual; my question is abouot using the existing C libraries and bypassing as many Arduino layers as possible.
Thank you very much
Pedro
I am starting work on a project where I will be using a Teensy LC to act as a USB to Serial converter with a twist: the Teensy LC will need to intercept and tweak communication for the specific application; so it won't be a simple get-send case, but get-parse-send (hence why and FTDI won't do)
The other issue is that we need the lowest possible latency (where FTDI doesn't excel either)
Therefore , for this project to be successful, I need to get the absolute best performance on the USB Serial implementation.
I've used Teensyduino for quite a while now, and on occasion, when I need to tweak a function, I dig into the Arduino libraries and the Processor Datasheet and tweak what I need. (for example, enabling 1 wire communication (i.e. merging RX and TX) on the UART using the LOOPS processor capability)
While doing so, it has become clear that most of the Arduino-style functions (such as Serial.read(), Serial.write(), and many others) are actually encapsulated in separate C files (such as serial.c), which are properly organized in functions.
This brings me to the following questions:
1) Wouldn't it be faster (and less bloated) if I just call the Teensy functions directly, bypassing the Arduino abstraction layer?
1a) In doing so, is there any toolchain or sample where I could start from (including Makefiles)?
1b) I realize that initializing the processor is not a trivial task; It is done by the Teensyduino library but I'm unclear if I can reuse barebones libraries for this; are there any advice pointers for this?
2) There are some published USB benchmark tests at the end of this page https://www.pjrc.com/teensy/usb_serial.html
2a) How do these compare to the current implementation of the stack on the Teensy LC / 3.2?
2b) Were they achieved using a full Teensyduino/Arduino sketch or a lighterweight code as I mention in 1)
3) Finally, any advice on reducing latency?
The biggest enemy we've had with FTDI is really the high latency; we're doing high speed USB-serial (as native Serial ports have practically vanished) and FTDI has several issues with unpredictable timing. Some seem to be on the OS side but others seem to be on the chip's own firmware (cahching, etc).
To be clear: I'm not looking to dig into 100s of pages of the processor or ARM manual; my question is abouot using the existing C libraries and bypassing as many Arduino layers as possible.
Thank you very much
Pedro