Hello,
I'm working on a complex project with a Teensy 4.0 and have encountered an interesting issue. Due to business confidentiality, I can't share the full code, but I'll describe the relevant parts and the problem I'm facing.
My setup includes:
Recently, I added an SPI device and was reading from it in the main loop. After this addition, I noticed the data transmission rate to Serial2 dropped to around 50Hz, while all other communication rates and calculations remained unaffected.
Interestingly, when I reduced the SPI reading frequency to 5kHz (or even lower), the Serial2 transmission rate returned to the desired 100Hz.
While 5kHz is sufficient for my needs, I'm curious about what caused this issue. Any insights into why adding SPI communication at a higher rate affected only the Serial2 transmission, despite the presence of other intensive operations, would be greatly appreciated.
I'm working on a complex project with a Teensy 4.0 and have encountered an interesting issue. Due to business confidentiality, I can't share the full code, but I'll describe the relevant parts and the problem I'm facing.
My setup includes:
- Reading data from Serial1 at 200Hz
- Sending data via SerialUSB2 at 100Hz
- Sending data via Serial2 at 100Hz
- Performing numerous complex calculations
Recently, I added an SPI device and was reading from it in the main loop. After this addition, I noticed the data transmission rate to Serial2 dropped to around 50Hz, while all other communication rates and calculations remained unaffected.
Interestingly, when I reduced the SPI reading frequency to 5kHz (or even lower), the Serial2 transmission rate returned to the desired 100Hz.
While 5kHz is sufficient for my needs, I'm curious about what caused this issue. Any insights into why adding SPI communication at a higher rate affected only the Serial2 transmission, despite the presence of other intensive operations, would be greatly appreciated.