Wednesday, April 29, 2009

the tlc5940 and arduino, some preliminary remarks:

now that the analog synth project is sort of done, thoughts turn toward the same design but as a sequencer-controlled analog synth. Forgo pots entirely and build a complex analog synth using LDRs; THEN control all the LDRs with LEDs driven by a serial LED driver (MAXX or Ti) from the arduino.

Also control an LCD display (sparkfun 2x16 serLCD), and use a pot and two or three buttons to program the whole thing. I bet it could be done with one button and one pot.

The programming would be annoying, because each beat would have about 10 or so parameters, but it would be very versatile. Saving data after shutdown may be an option, with primary goals being beat programming and arbitrary sequence length (for nontraditional tempos), with a ’hit’ function that previews a beat while working on the settings.

So experiments begin with the MAXX and Ti drivers- 16 leds with 4096 levels should be enough... (They’re very easy to daisy chain too)

Anybody have any experience with the sequencer programming part? I guess it’s going to be an array of variables with length n set by the number of beats programmed. It’ll be fun to look into the whole thing.

Ooh, ’reverse’ loop and manual triggering as well.

Got the first part, TL5940, all set up. (MAXIM 7221 doesn't do the pwm thing, so it has fallen from favor)

Amazing piece of hardware! IC plus 3 components controls 16 individual LEDs, with 4096 shades from off to full on. (they'd also control motors or servos) the best part is these LEDs don’t even need limiting resistors. It doesn’t care about the forward voltage of the LEDs either, so low voltage red ones can be used right next to 4+ volt near-UV LEDs, completely nekkid, with one leg in +5V, and another into the TL5940 with no care in the world!

The programming part looks great too, the code library makes it simple to address each LED and tell it what fade it should be. fade durations can be set too: fade up/fade down for envelope controls... each LED can fade up/down independently of the others in software as well.

Now to get the nice red backlit LCD display connected and figured out a bit.

Worked out a way to get as many controls as needed from a single pot: use it as a voltage divider. Then the arduino can do X if the voltage is below a certain point, and Y above that point. The pots’ range can be divided up as many ways as needed to allow scrolling through options...

one pot, one button, with at least ’set’ ’forward’ and ’back’ with a twist of the pot, for each value being accessed in the sequencer.

Once the hardware’s built, the software can be updated without touching the soldering iron. This, to someone familiar with analog stuff, is mindblowing.


so the arduino and 5v TL5940 will be one board, controlling a 9-12V synth circuit on another board via LEDs and light-dependent resistors.

One other thing: the arduino analogread () is only half the available resolution of the 5940s 4096 shades, so I think dividing the pot again will help: a bit north and south of center, it will take 2048 (the middle value) and add or subtract one, repeatedly. Further toward the ends, it would do it faster and faster, allowing the user to controllably scroll through all 4096 brightness values without dealing with the limits of the analogread () pin.

On a side note, I wonder what sounds could be made straight off the 16 fully controllable PWM ’voice’ pins on this IC.

No comments:

Post a Comment