Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By mtongnz
#40537 I am working on a similar project and stumbled across this page. I use a different approach to sending the break and MAB... I pinched the idea from the dmxSerial library by Matthias Hertel. He simply changes the serial baud to 10k with 8e1 coding, writes a 0, then switches back to 250k 8n2 coding. It works perfectly.

Code: Select all// Ensure all data is sent
Serial1.flush();
delay(2);
Serial1.end();

// Send Break & MAB
Serial1.begin(10000, SERIAL_8E1);
Serial1.write(0);
Serial1.flush();
Serial1.end();
 
// Send DMX start code 0
Serial1.begin(250000, SERIAL_8N2);
Serial1.write(0);

// Now send DMX data
for (int x = 0, x < maxChans, x++)
    Serial1.write(dmxData[x]);


I am currently working on making my code work using interrupts to send the data as I want to output 2 universes and it's too slow using the main loop.