Intro: Daft Punk Table Replica Graphics Controller

Step 1: "Table" details.

mrgalleta presents a pretty good writeup of his daft punk table construction, with less emphasis on the electronics. If you want to know more about c...

This instructable presents a graphics controller card for something like the Daft Punk Table Replica. This should be used in conjunction with a driver board (output expander) like this one, which will drive the high loads presented by the table. This is a work in progress and collaborations on this instructable are welcome.

*audio used under creative commons license, see youtube for details.

The graphics controller does three things:1) Accepts display instructions from a USB port (virtual com port compatible with old winamp plugins). 2) Reads display scripts from an SD card. Display scripts are made on a PC using the seq_txt program (and source) attached to this instructable.3) Decodes display instructions and sends them to the driver board(s).

USBThe board uses a 28 pin PIC with USB hardware. This is super easy to implement using the microchip USB CDC driver. I haven't bothered to implement this yet. I don't plan to use it and a bit of memory trickery is required. The 18fX550 USB PICs only have 2K of ram. The FAT file system (below) uses 2 512K buffers to read the SD card. That is taken from the upper 1k normally reserved for USB by the microchip CDC driver. SO: since USB use will always take priority (ie SD card play will stop and the table waits for instructions after USB is plugged in) we can just reuse the FAT memory buffers for the USB when connected. Also note:the USB Vcc pin is actually connected to a PIC pin. This is so we can detect a usb cable without full enumeration (maybe?).

SD cardAnimation files can be made with the seq_txt.exe (windows) program (and source) attached to this instructable. The original files can be found here. I did not write these. I believe they were created by instructables user Mathieu Roncheau. Its a bare EXE file from an unknown source. Use at your own risk (but I've had no problems). Click on the squares in this program to create images that will display on the daft punk table, click '>' to make a new frame. Click the disk to save a plain text representation of the images you drew.

Here is an example of the file that goes with the image shown in the screen shot below:

1 2 4 8 16

This is the ascii representation of the binary equivalent of each column, with the top as 0. The first column is 10000 = 1, the third is 00100=4, and so on. Each line represents a frame, each line is terminated with both \r and \n.

These animation files are copied to an SD card (like your digital camera uses) just like any other disk. The controller accepts SD cards in any of the common formats (FAT12/16/32) thanks to a stripped down version of DOSFS by Lewin Edwards.

The controller reads through all the *.dpt (daft punk table) files in the root directory of the SD card and 'plays' each one. When all files are read it starts over at the beginning.

Display DecodingNo matter how the data gets into the controller, it arrives as ASCII representations of bitmap images. Yuck.

We need to convert the ascii data to a real integer. In the example above the last column (00001 in binary) is represented by 16 in decimal. 16 is actually represented by two bytes on a PC - 1 & 6. Furthermore, these bytes are encoded as ASCII, 1 is actually 0x31 and 6 is actually 0x36. A) Subtract 0x30 from each digit (|= 0x30...xor?).B) Add first digit to new variable XC) Multiply X by 10D) Add second digit, repeat C & D as needed to process all digits.

Once that is finished its just a matter of banging the bits out a few pins.

Code StatusThe code is just barely alpha. I wanted to get the PCB and code posted because a few people have written expressing interest. The USB driver is not yet implemented and requires some attention to memory organization. The FAT & SD libs work great, it reads files in a loop without any problem, but only FAT 16 has been tested. The code has not yet been moved into neat functions, its simply 'as is' from my first working prototype.

Future improvements:

USB connectivity through CDC (virtual com/serial port).

Built in font for rendering plain text over USB or reading .txt files from the SD card.

Use built in font to display NO CARD/BAD CARD messages.

Error handling on SD reads and animation parsing.

ADC ports were left available for beat detection based speed control.

ADC/DIO ports left free for switches or potentiometers.

Add loop and speed instructions to the animation script format...since bitmap values are always 0-31, a value of 32 could trigger a loop of N times determined by the next digit. A value of 33 could specify a new update rate (speed).

Hardware test/power on self test (POST) - write bytes into the IO expander, and read output from last board in the chain. If bytes out=bytes in then hardware is functioning correctly (requires loop-back connection to last output expander board in the chain).

Hardware Overview

PCB and circuit are in Cadsoft Eagle format.

Firmware written with MPLAB & C18 compiler.

For the geeks: The microcontroller is a 28 pin 8 bit PIC18f2550 with USB hardware and 2K ram. It runs at 5 volts because it needs 48 MHZ to do the USB interface (via a 20Mhz crystal). The SD card is 3.3v only logic. The SD card has its own +3.3 supply from a LM317 feed from the 5.1V shared by the PIC and LEDs. Its not strictly perfect, but it works. The signals into the SD card are divided to around 3V using a 2.2K and 3.3K resistor divider. The data output from the card to the PIC is left bare, the 3.3V high is enough to trigger Vh on the PIC. I picked up the voltage divider design from the MikroeBasic compiler manual. This is not an ideal arrangement, I had to cut the SPI speed down to clock/64 before I could reliably communicate with the SD card. However, this is read only operation where speed doesn't really matter so it worked out perfectly (and cheap!).

I buy all my high power LEDs (13,000mcd @20 degrees) from besthongkong.com - they have a web-store and ebay listings. I always buy from the web-store. In 50+ the price is pretty reasonable. BE CAREFUL!!!!!!!! They most certainly sold my e-mail to many spammers over the years. I always use the website name @my domain for orders, so I know who spams. I still get a huge amount of spam to besthongkong.com@{mydomain}.com. Be sure to use an e-mail you can later filter.

Curious, how do drive the LEDs? I am assuming you have say 12V across each of the 25 sets of LEDs and with each of them sunk on 25 pins of the ULN2803. I built a similar project once using MUXing where I drove 7 lines from the MCU through a driver and using a ULN2003 to sink the current.

hi, i would like to make a daft punk table but i don't know anything about electronics and micrcontrollers: how to program them and how to get program on them could someone please tell me how to do with detailed steps? thanks

Here is the code for the PIC pin configuration: #define GFX_DO LATAbits.LATA2 //#define GFX_DI //for eventual POST (self test) by reading bytes in and out of 595s.... #define GFX_CLK LATAbits.LATA1 #define GFX_CS LATAbits.LATA0 PIC DO is PORTA.2 this connects to the driver board DI/SI PIC CLK is PORTA.1 this connects to the driver board clock. PIC CS is PORTA.0 this connects to the driver board latch/chip select/enable. PIC DI is an extra pin that is not yet used. The data you put into the driver board comes back out on the other side, so its possible to read what comes back out to verify that all the electronics are in order (a self test). I never wrote the code, but it could be a cool feature.

If anyone makes some animations/sequences with the seq_txt.exe program attach them to a comment here and I will play them in my daft punk table replica (replica). :) If its super cool I'll make a youtube video of it. Instructables changes the file name in my browser, you may have to rename it. Better yet, download the source code in the archive and compile it yourself :)