Serial TX Interrupts
Posted: Fri Feb 05, 2016 10:32 pm
I am building an ArtNet/sACN to 2 DMX project. It is used in professional lighting applications and takes network data and spits it out via the serial ports.
I am trying to output to Serial0 and Serial1 at the same time using data coming in via WiFi UDP packets. I have everything working using standard Serial.write commands but the delay caused by these is causing glitches in the very timing sensitive DMX output. I need to run it using TX interrupts so i can output to both serial devices concurrently.
My question is, what are the registers to write data to in order to send data via the serial ports and how do I initialise the interrupts?
On an arduino, I would setup the ISR & send data using these lines of code:
I can't find where all the registers are defined. Is there an equivalent code that works for esp8266?
p.s. I'm using the Arduino IDE for ESP8266
I am trying to output to Serial0 and Serial1 at the same time using data coming in via WiFi UDP packets. I have everything working using standard Serial.write commands but the delay caused by these is causing glitches in the very timing sensitive DMX output. I need to run it using TX interrupts so i can output to both serial devices concurrently.
My question is, what are the registers to write data to in order to send data via the serial ports and how do I initialise the interrupts?
On an arduino, I would setup the ISR & send data using these lines of code:
Code: Select all
// Enable TX and setup TX complete interrupt
UCSRnB = (1<<TXENn) | (1<<TXCIEn);
// Enable TX and setup data register empty interrupt
UCSRnB = (1<<TXENn) | (1<<UDRIEn);
// Put data in TX buffer (which sends it)
UDRn = data;
I can't find where all the registers are defined. Is there an equivalent code that works for esp8266?
p.s. I'm using the Arduino IDE for ESP8266