This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Software UART Bitbang with CTS

Hi guys, 

I would like to establish a software UART using bitbang. The current setup works by enabling an interrupt when the start bit is received, and staying in that interrupt using delays to sample the pin and interpret the characters received.

The bitbang UART runs at 9600bps, so it stays in the interrupt for a really long time! That was no problem before, but I now want to add more functionality to the project. My MSP will receive a signal from a master device via UART (on the bitbang pin, because the Hardware UART is used for communication with another device.) Once that string is received, my device should respond with some sensor values which should already be in memory.

Here is what I am thinking:

1) Measure sensors (takes upwards of 250ms)

2) Activate CTS pin and wait for a start bit (introduce a delay which is long enough to receive start bit)

3) If no start bit received, de-activate CTS (and stop communication for now) 

4) Else, sit in interrupt until all data is received, and then transmit sensor data to master

5) Repeat... 

 

Do you guys think that will work or should I absolutely use an RTS line from the master to my MSP? 

 

Thanks a lot,

Alvaro

**Attention** This is a public forum