Arduino Nano, interrupt and UART questions
Posted: Wed Jul 03, 2019 5:09 pm
Hello,
I'm working on a project that uses a (Chinese), Arduino Nano.
This sends a serial datastream via a UART component, and expects a reply somewhat later.
I want to make sure that every time there's is data coming back, the UART catches it and stores it into a variable.
I got a nice reply from behind the scenes using an interrupt and a circular buffer.
But, the Nano only seems to have an interrupt on UART0 (?) and on both falling AND rising edges.
I can't select only falling edges for the RX pin (digital0 (PD0)) so it seems that the trick with the interrupt won't work?
What is the best way to capture the data that appears on the RX line of the UART
The trick I've got uses a header to search the circular buffer for the beginning of the data, but for this, the interrupt on UART0 must work.
So; what is the best tactic for me to make sure that data is captured on the RX of the UART and gets stored into a variable.
After that, I will compare the received data with data that is stored.
I'm working on a project that uses a (Chinese), Arduino Nano.
This sends a serial datastream via a UART component, and expects a reply somewhat later.
I want to make sure that every time there's is data coming back, the UART catches it and stores it into a variable.
I got a nice reply from behind the scenes using an interrupt and a circular buffer.
But, the Nano only seems to have an interrupt on UART0 (?) and on both falling AND rising edges.
I can't select only falling edges for the RX pin (digital0 (PD0)) so it seems that the trick with the interrupt won't work?
What is the best way to capture the data that appears on the RX line of the UART
The trick I've got uses a header to search the circular buffer for the beginning of the data, but for this, the interrupt on UART0 must work.
So; what is the best tactic for me to make sure that data is captured on the RX of the UART and gets stored into a variable.
After that, I will compare the received data with data that is stored.