Hi all.
I am working on a project involving a light sensor driven by Teensy 3.6 and using Raspberry Pi 3B as mini-computer.
Basically, the sensor data are collected by Teensy 3.6 and serially transmitted to Raspberry where a Python script reads them with the Python serial library and process them with several algorithms.
Everything works very well when Teensy and Raspberry are connected by a micro USB-USB cable and data communication is performed by using "Serial" instruction. When light source changes at the sensor, Teensy collects the signal and transmits it to Raspberry where the output is updated near in real time.
Now I'm testing "Serial1" on Teensy by using the Teensy pins 0 and 1 (RX1 and TX1) and Raspberry GPIO pins TXD and RXD.
I've updated Raspberry settings so that all data are read by Python script at Raspberry "ttyS0" serial port.
Indeed data transmission from Teensy to Raspberry is performed but it happens much more slowly than with USB communication. The strange thing is that commands I send by Raspberry to Teensy (through the Python graphic interface I've set on Raspberry), that are single bytes, are actually read by Teensy near in real time (I understand this because they enable/disable leds driven by Teensy).
Is this a problem of data transmission speed and/or buffering between Teensy and Raspberry with the Serial1 interface that requires some setting different from the case with Serial/USB communication? I would be very happy to have some indications.
Thanks in advance.
Best regards
Franco
I am working on a project involving a light sensor driven by Teensy 3.6 and using Raspberry Pi 3B as mini-computer.
Basically, the sensor data are collected by Teensy 3.6 and serially transmitted to Raspberry where a Python script reads them with the Python serial library and process them with several algorithms.
Everything works very well when Teensy and Raspberry are connected by a micro USB-USB cable and data communication is performed by using "Serial" instruction. When light source changes at the sensor, Teensy collects the signal and transmits it to Raspberry where the output is updated near in real time.
Now I'm testing "Serial1" on Teensy by using the Teensy pins 0 and 1 (RX1 and TX1) and Raspberry GPIO pins TXD and RXD.
I've updated Raspberry settings so that all data are read by Python script at Raspberry "ttyS0" serial port.
Indeed data transmission from Teensy to Raspberry is performed but it happens much more slowly than with USB communication. The strange thing is that commands I send by Raspberry to Teensy (through the Python graphic interface I've set on Raspberry), that are single bytes, are actually read by Teensy near in real time (I understand this because they enable/disable leds driven by Teensy).
Is this a problem of data transmission speed and/or buffering between Teensy and Raspberry with the Serial1 interface that requires some setting different from the case with Serial/USB communication? I would be very happy to have some indications.
Thanks in advance.
Best regards
Franco