LPC810 DMX.

Note

Another post I wrote a while ago and then got very busy and never published.

Introduction

I have already written some DMX code to run on a STM32 arm chip and was interested to see how this matches up to the itsy bitsy NXP LPC812. A 32 bit arm in an 8 PIN DIP package. Refer to the previous post for details on DMX. I took this with the aim to use an android tablet to control a stage lighting kit, imagine being to wander the room with no cables just a little dongle plugged into the dimmer chain.

Hardware

The LPC8xx series gain a lot of flexibility with the switch matrix tht allows most IO pins to be repurposed and to shift features around to suit PCB layouts. I initially assembled this on a breadboard and have recently transferred it to matrix board. The hardware consists of the ARM chip, a balanced line driver and a connector for a blue tooth module.

I chose to keep the main async interface on the pins used by the serial bootloader, yes these things are simple to program. And to connect the Tx line of the second async interface to another IO pin. My hardware includes a bi colour LED and a couple of switches.

The bluetooth module is preloaded to run the serial port profile (SPP), I had to chnage th baud rate. These are available on ebay for circa £5 each try searching for HC05/HC06, the later is fixed as a a slave device whilst the HC05 can be a master. The one I have is on a carrier board with voltage regulator.

Software

This is about 2kBytes when compiled (the chip has 4K flash, 1K ram) and runs all in interrupt state, the main loop is while (1) ;

There are 3 interrupt sources, the systick timer, and two usarts. There is a memory buffer of 512 bytes for the DMX channels, I suspect when I add some scene functionality I shall have to reduce the maximum channel count I can support.

Testing

To test initially I connected an FTDI USB uart adpator to the relevant pin on the connector for the bluetooth. And then used a little python script to sequence an LED PAR lamp. After fixing some polarity issues, had this issue on the STM32 as well but simpler to fix on the LPC. We had lights changing. I then swapped in the bluetooth module and set up the linux side of the serial over bluetooth. This took a while, looks as if the bluetooth connecton can be slow to pair when you open the linux end. But same python script talking to the bluetooth end point.

Conclusion

The LPC are nice little chips and easier to write firmware than for the low end PIC chips. For initial development I would sugggest use the 20 pin variant as the extra pins will make debugging easier and then rebuild for the smallest version. They are a joy to use.