Hello guys,
i would like to make a unit, based on Pro Mini 5V 16Mhz, that has 3 serial channels.
Channel #1 is used to read / write data to and from a RC turbine engine ECU. at fixed 9600 baud.
Channel #2 is used to talk to Sbus2 Futaba Receiver at 100K baud (has to be HW serial i guess). this channel needs minimum latency to both read and write, so will be out of the state machine in the code and run every main loop.
Channel #3 is used to transfer parsed data from Channel #1 to a BT module (can configure to any baud rate i like).
And lastly, Channel #4 will be I2C to print the data on LCD.
would like to get your recommendations as far as baud rates and serial libraries (hw.serial, sw.serial and alt.sw.serial and so on).
i did read the tips on the AltSWSerial github page:
http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html
Here is the relevant quote:
"Using Both SoftwareSerial and AltSoftSerial
It is possible to use both SoftwareSerial and AltSoftSerial, and of course HardwareSerial, to have 3 serial ports! However, the baud rates must be chosen carefully!
Because SoftwareSerial creates 10 bit times of latency for other libraries, it should be used for a device needing high baud rate. SoftwareSerial should NOT be used at slow baud rates, because it will interfere with the other ports. SoftwareSerial can not simultaenously transmit and receive, so it should be used with a device that never sends in both directions at once.
HardwareSerial can tolerate up to 20 bit times latency for receive, or 10 bit times for non-stop transmit. To maintain full transmit speed, HardwareSerial's baud rate should be no greater than SoftwareSerial's. If continuous transmit is not needed, HardwareSerial can use a baud rate almost twice as fast as SoftwareSerial and still reliably receive. But more than twice SoftwareSerial's baud will not be able to receive reliably.
AltSoftSerial can tolerate almost 1 bit time latency, so its baud rate must be at least 10 times less than the baud rate used for SoftwareSerial.
If the baud rates are chosen wisely, all 3 can work together reliably! "
So i thought about doing the following:
HW serial for Sbus2 100k baud
SW Serial 57600 for BT module
alt SW Serial 9600 for ECU
im not entirely sure all of this can be managed reliabely.
any tips would be welcome.
thanks.
