I want to read data from an accelerometer sensor, which pushes its data to the Arduino via an external interrupt. I then want the Arduino to relay this data to a host computer via the serial connection.
Will the external interrupt interfere with the serial connection? If the Arduino's in the middle of transmitting via serial, and the accelerometer triggers the interrupt, won't that potentially break the serial connection?
-
What do you mean by "break the serial connection" exactly?Nick Gammon– Nick Gammon ♦2016年07月10日 07:35:07 +00:00Commented Jul 10, 2016 at 7:35
1 Answer 1
Transmitting a single character via UART on the ATmega328P (and all other AVRs with a dedicated USART) cannot be interrupted since it is independently clocked. Loading the next character into the transmit buffer can be (since the INTx
interrupts have priority over the USART,xxx
interrupts), but this will not actually break communications, just slow it down.