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.
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.
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.
(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.
|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|
|S101||S101||SWITCH_PUSHBUTTON_NO||SMD_SIMPLE 270 50|