Page 1 of 1

Use Timer Interrupt for Software Serial Comms

Posted: Wed Sep 26, 2018 8:12 am
by medelec35
Would it be possible for the software serial e.g UART, SPI I2C etc use timer interrupts for better control?
It would be nice to be able to select timer as you can with PWM.
Currently If using software and interrupts fire then pulse stretching takes place.
Depending on the interrupt speed, data could easily fall outside allowed tolerances thereby causing corrupted chars.
For example, I'm using interrupts to detect the speed of two fans.
Unable to use hardware UART due to unable to modify hardware.
The faster the fans the more data corruption occurs.
What I have to do was pause the UART transmission enable interrupt, measure tacho for a short period, disable interrupt.
Use a multiplying factor, send UART etc.

Re: Use Timer Interrupt for Software Serial Comms

Posted: Wed Sep 26, 2018 1:11 pm
by Benj
Hi Martin,

I like it, great idea. I'll get the cogs whirring and see if I can come up with an easy way to implement it :wink: