mnf wrote: ↑Wed Sep 09, 2020 7:05 am
It's possible but not easy. You could busy wait watching the rx pin for a change of state and then receive - we managed this for the j1850 bus (effectively receiving data at 9600,baud) but timing was tight..
Use an Arduino mega. It has multiple tx/rx and this makes life much easier for debugging programs using comms.
Use a different interrupt - use a different pin for the Arduino to signal transmission start - pull a pin high.
Martin
Thank you Martin,
I've followed a few of your suggestions.
I just have access to a Arduino Nano (168), but I've changed the setup so the software UART uses Port D2 as RX.
This is the INT0 on the chip. (TX of the UART is port D4 at this moment)
But either which setting I use for the interrupt, to read a byte from the UART and store it in the circular buffer.
Even with an interrupt.. there is no decent capturing of data from the RX pin.
I've had this problem before and I don't know why.
I start the interrupt on INT0 input: falling edge... there is an interrupt, but in the macro it calls it only tries to read a byte (receive char) and put this byte in the CB (put byte).
I've tried several ways to interrupt (rising edge .... and so on).
I don't know why, but I've had this problem in FC8 before, and I've managed it in FC7.
Why is working with CB in combination with an interrupt cursed for me?
Isn't it possible with this hardware? Is there still remaining timing problem? Is the chip too slow? Too fast?
The UART speed is 57600bps and this works fine with the hardware attached..