CPLD LED blinker based on XAPP078
I'm working on a board that will exceed the Eagle freeware limitations, so I am experimenting with gEDA, which includes the schematic capture program gschem and pcb. This is a board I made to try out the workflow.
The board is for a friend of mine who can't resist blinking LEDs. This should force him to learn Verilog, since I plan to deliver it with the CPLD erased. The design is based on my experience designing my first CPLD prototype board several years ago. The keys are:
- Use a very, very slow clock. If your goal is blinking visible to humans, a 1MHz clock requires 20 flops to divide down to 1Hz. A Xilinx XC9536 only has 36 total flops. This board has a ~60Hz clock generated by a 555 timer.
- Don't get fancy with the peripherals. This has one button and 8 LEDs. A 36 macrocell CPLD project like this is not likely to get incorporated into other things, so keep it simple.
- Don't bother with a socket. A PLCC socket with PGA-style pinout is a pain to do with home equipment, while a surface mounted PLCC package is pretty easy to deal with. I thought the socket would make it easy to use my proto board as a programmer, but in practice you always put a JTAG header on your boards anyway, so you can program everything in-circuit.
Construction
Using the 'export to PS' function of PCB with mirroring turned on gave me a printable image that I used to do an iron-on toner transfer to the PCB. You can find lots of how-to sites for toner transfer PCBs. The artwork was modified to include two copies of the board. What I do is print once on paper, then take my clay coated paper and tape it over the image to ensure I have it properly aligned, then use the bypass feed when I do the final print. The new Xerox printers at work are great for this—you can set a job to use the bypass, print it, walk over to it, insert your sheet, and then choose your printjob from a menu of jobs needing special paper.
After etching and drilling (only 17 holes! Yay for surface mount) I use the unmirrored output of pcb to get an assembly diagram to aid in component placement. The schematic is also handy. If you want to look at the original project files instead of PDF output, they are available in a zip file.
Surface mount?!
Another component (heh, heh) of this project was to try surface mount technology at home. I've worked with tiny stuff (down to 0402) at work with a stereo microscope and Metcal solder station. I wanted to see how I'd do with my factory-issue eyes and a temperature controlled solder station. I selected 0805 as my basic size, since resistors are still labelled down to 0603, with the edge going to 0805 because I can usually read those without magnification. I bought a few kits from Nightfire Electronic Kits. For about $50 you can have a few dozen of every common resistor value, capacitor value and transistor.
The project uses several 0805 resistors, a couple low-value 1206 resistors to jump over tracks and some 0603 .1u caps. Ceramic surface mount capacitors are almost never labelled anyway, so 0603 doesn't sacrifice much. I find it's easier to work with the tiny chip cap than to drill the holes and bend/trim the leads of a leaded part. Another advantage of surface mount parts is that you can usually go up or down a package size without much trouble. The LEDs could be replaced by ones that were quite a bit smaller or even slightly bigger. Almost all of the resistors and capacitors could go up or down a package size and still be put on the board.
BOM
(also available as a tab separated file and in the zipfile)
Most values are not cricital. Choose R101-108 to go with your LEDs. The 1206 resistors are just to jump tracks and could really be any small value. The whole thing might work without some or all of the .1u caps, except for C104 which is for the timer. Control the clock frequency by varying R109.
package | refdes | device | value | footprint |
---|---|---|---|---|
C101 | C101 | POLARIZED_CAPACITOR | 4u7 | TANT_C |
C102 | C102 | CAPACITOR | .47u | TANT_A |
C103 | C103 | CAPACITOR | .1u | 0603 |
C104 | C104 | CAPACITOR | .1u | 0603 |
C105 | C105 | CAPACITOR | .1u | 0603 |
C106 | C106 | CAPACITOR | .1u | 0603 |
CONN101 | CONN101 | PWRJACK | JUMPER2 | |
CONN102 | CONN102 | CONNECTOR_6 | JUMPER6 | |
LED101 | LED101 | LED | SMD_SIMPLE 130 100 | |
LED102 | LED102 | LED | SMD_SIMPLE 130 100 | |
LED103 | LED103 | LED | SMD_SIMPLE 130 100 | |
LED104 | LED104 | LED | SMD_SIMPLE 130 100 | |
LED105 | LED105 | LED | SMD_SIMPLE 130 100 | |
LED106 | LED106 | LED | SMD_SIMPLE 130 100 | |
LED107 | LED107 | LED | SMD_SIMPLE 130 100 | |
LED108 | LED108 | LED | SMD_SIMPLE 130 100 | |
R101 | R101 | RESISTOR | 330 | 0805 |
R102 | R102 | RESISTOR | 330 | 0805 |
R103 | R103 | RESISTOR | 330 | 0805 |
R104 | R104 | RESISTOR | 330 | 0805 |
R105 | R105 | RESISTOR | 330 | 0805 |
R106 | R106 | RESISTOR | 330 | 0805 |
R107 | R107 | RESISTOR | 330 | 0805 |
R108 | R108 | RESISTOR | 330 | 0805 |
R109 | R109 | RESISTOR | 100k | 0805 |
R110 | R110 | RESISTOR | 10k | 0805 |
R98 | R98 | RESISTOR | 0 | 1206 |
R99 | R99 | RESISTOR | 51 | 1206 |
S101 | S101 | SWITCH_PUSHBUTTON_NO | SMD_SIMPLE 270 50 | |
U101 | U101 | 780x | 5V | TO92 |
U102 | U102 | LM555 | DIP-8-300 | |
U103 | U103 | XC9536 | PLCC 44 |