NSL Cylon II
From Null Space Labs
Next version of the Cylon
2030 1206 LEDs
- 3x momentary switch (metal) Hengtai SFE
- ATTiny2313 Data sheet Mouser Digikey / Attiny24 Datasheet Digikey
- PWM speaker Buzzer How the buzzer works Datasheet
- Serial TX/RX
- ASM and C versions of the code
- One wire debug, which frees up the SPI mode.
- Microphone (ATtiny24 version only) or some discreet ADC for 2313 MEMS Microphone SPM0408HE5H Digital MEMS Microphone
- 5 way switch Hengtai Datasheet SFE
Shrink size (maybe)shrunk Decide on 30 or 20 LEDs(30)
- Finish code and upload to wiki
- Figure out the deal with TV-B-Gone mode
Use this link to load and create a circuit simulator, this needs Java Two LEDs
- Toggle the H and L with the mouse, use the switch to turn on and off the line, this basically simulates 'tristate' ON(H) OFF(L) and Dont care(X), but we only need HIGH and LOW for this first step. You can switch on two LED's by switching the H and L.
- Now we expand to use the tri-state 3 Pins 6 LED
\ By changing the H/L inputs and switches to on or off, that you can control each LED separately. Simulating a tristate, on off and not connected, or high impedance.
The number of LED's that can be charlieplexed is determined by the following formula OUPUTS*(OUTPUTS-1). So if you have 3 pins, that is 3*2 = 6. Additionally (OUPUTS-1) LED's switched on at any one time So with 3 pins you can have two LED's on at any one time.
This works because LED's are diodes, so they'll let the current flow one way, but not the other way and that on some uC's you can set high low and dont care (which is typically input). When the pin is input mode, it doesn't affect the circuit since its just reporting what is there. A visualisation of this is in the simulator by way of the current flow.
Wikipedia has a write up too wikipediafile
During the build a few mistakes were made, first simple copy paste errors in schematic and not triple checking the label names, its easy to do and no matter how many times you go over it, it'll likely happen this is where the wire jumpers come into place. Another problem was the metal switch has a clip underneath that just happened to touch the trace to the speaker so shorted it out when pressed (only affects the CNC versions, since there is no mask). This maybe related to the actual switch itself and using the wrong hotplate soldering profile, as the cover came loose. however the trace still needs to move, just in case.
Finally on the 3rd revision I managed to somehow isolate the ground from the battery and eagle didn't pick it up, a quick trim with the knife and it was fixed, again easy to do we added another trace to the already working board, shrunk the dimensions, and sliced the ground plane. Eagle will normally show an airwire, but I've noticed sometimes it doesn't if you don't do a ratsnest command.
Power usage is higher, with 200 ohm resistors and the speaker running constantly with all led's lit, we get about 5 hours runtime, with 470 ohm resistors it looks to be about 8. This is with continuous tone and all led's. with running mode and no speaker so far the the first prototype has been going strong for about two days, its using 280 ohm resistors (we're using different resistor values to alter the brightness of the LEDs). Next power test is to have the LED's do various modes and the speak play music and see how long that lasts. Adding a resistor to the speaker may help too.
Turned out the speaker was on all the time !
Added larger battery holders , CR2450s. Tried 6V with white leds and two CR2032s , tried two CR2025s in CR2450 holder (all variations seem to work) New speaker? 10V for a 1/2 second didn't blow the chip!!
Virtual Cylon II
We're going to try to offer people a way to make the Cylon II before getting hardware, both hardware and software emulation.
Here are some links for you to try this too, some of these do circuits, some do mcus, so do AVR's, none of them may do the ATTiny2313 but you can add it if they don't.
Some of the ways of doing this are just to write a tool that does the patterns, but doesn't let you do the code. Then we can emulate the CPU and the LEDs, speakers etc. A circuit simulator can do a good job of emulating the charlieplexing and pwm, which will let you look at whats going on in the circuit.
- File:NSL CylonII.c Test Code for AVR Studio 4
- LTSPICE free
- MultiSim Not free, but 30 day demo
- ATMEL AVR Simulator
- AVR simulator
- AVR Simu
Available on the NSL SVN
Under "/032/NSL_CylonII/" Make sure the CLKDIV8 fuse is set "off".
- Added two extra switches
- Moved leds closer
- Changed order of IO extensions to match mmca's ir sensor g/v/s
- Added logo
- Approved at BatchPCB