The media in this post is not displayed to visitors. To view it, please go to the original post.
Yes, you can absolutely build a USB (or, with an ESP8266, MQTT) to DMX adapter with an ATMega328 (as available on Arduino Nano or variants thereof), despite the fact that it only has a single UART.
All you gotta do is run TDMA between USB / UART input (57600 baud) and DMX output (250 kbaud). Also known as: Just send the desired output pattern several times, one of the transmissions will fall into the ≈300ms gap between two consecutive DMX frames.
Mwahahahaha :3
arti reshared this.
Z̈oé
in reply to derf • • •ity [unit X-69] - VIOLENT FUCK
in reply to derf • • •ity [unit X-69] - VIOLENT FUCK
in reply to ity [unit X-69] - VIOLENT FUCK • • •I understand the words USB, UART, ATMega, ESP8266, Arduino Nano, MQTT
USB and ESP8266 & ATMega stuff I even touched! (Tho only USB 2.0, on an RP2040)
Luna
in reply to ity [unit X-69] - VIOLENT FUCK • • •@derf
derf
in reply to ity [unit X-69] - VIOLENT FUCK • • •@ity basically: DMX is a protocol for lightning fixtures that can also be transmitted with a UART hardware interface. However, the ATMega328 (8-bit microcontroller in an Arduino Nano, with a whopping 16 MHz / 32 KiB Flash / 2 KiB SRAM) only has one such UART → it cannot receive data via USB and output DMX at the same time, as the two use incompatible line speeds (baud rates).
Enter TDMA (time division multiple access): alternate between receiving USB (UART @ 57600 baud, transmit line for DMX idle) and sending DMX (UART @ 250 kbaud, receive line from USB not used).
That's it, really^^
ity [unit X-69] - VIOLENT FUCK
in reply to derf • • •ah, I somewhat follow I think (?)
Any reason to not do an RP2040 instead? Seems interesting nonetheless tho :3 kinda wanna forward it to a friend that did bitbanged UART & SLIP on an attiny85
derf
in reply to ity [unit X-69] - VIOLENT FUCK • • •arti likes this.
ity [unit X-69] - VIOLENT FUCK
in reply to derf • • •ooo
The RP2040 has two UARTs, one over its USB 2.0 controller, the other routed to PIO pins
It's very nice, the baud should be high enough too (plus the thing can do PIO faster than its own clock speed, the PIO is tied to shift registers and a few other fun things)
And yea, hardware limitations are very fun :3 I'm still bad at embedded engineering unfortunately, but it's really cool to watch others do these kinda things
ity [unit X-69] - VIOLENT FUCK
in reply to ity [unit X-69] - VIOLENT FUCK • • •arti likes this.
arti
in reply to derf • •If you do not really need the speed an Atmega328PB has an even smaller footprint, internal flash and eeprom and is sufficient for most use cases.
You can place them both by hand if you can reflow or have hot air.
@ity [unit X-69] - VIOLENT FUCK @derf
arti
in reply to derf • •ity [unit X-69] - VIOLENT FUCK likes this.