DCC & DMX CONTROL

More of a hobby project that was originally written 20 years ago in C using MPLAB and more recently updated to C++. The original code (a state machine driven from hardware interrupts) ran on a PIC16F driving a full H-Bridge to realise an NMRA compatible DCC (Digital Command Control) locomotive decoder.

A few years later I got involved with an amateur dramatics group where I helped them update their lighting to DMX512 and saw the opportunity to master another single master multi slave protocol.

Stage lights and model trains don’t initially look like easy partners but they are both primarily receive, state-driven serial protocols and it was fun to see if I could use class abstraction to have a single code base driving both projects spanning three protocols (NMRA DCC, Hornby Zero-1 and DMX 512). Was it overkill? Possibly, but what are hobbies for if not to indulge in an idea or two.

TO DO: Add state diagram and hardware block schematics.

In another little railway project, I used a couple of 16 channel relay boards and a chain of half a dozen 74595s all linked to an Arduino Nano to automate a display layout. Two of the 595’s drive reed switches with one end connected via steering diodes to a GPIO having a mapped interrupt handler to make a 16 column, single row ‘keyboard matrix’. ‘Inputs from outputs’, neat! To get the scanning performance I needed the SPI hardware built into the AVR chip drives the 595 chain, although not a true SPI application it works a dream. The AVR only has one SPI interface so a 2 line LCD was linked using I2C to give user feedback.

TO DO: include a photo of the controller.

Scroll to top