Sie sind auf Seite 1von 22

53 LED CUBE Controller

for PIC16F688
Description Schematic Circuit Description PCB Layout Component List Construction photos Important Cube Assembly info' Troubleshooting Operation Firmware V1.0.4 ledcubeC3.HEX 15-01-2011 Drawing Processor Page last updated: February 17, 2011

Now available from the on-line store Short kit includes all parts to build working cube (excludes main cube LEDs) Description Do a search on YouTube and you'll turn up literally dozens of video clips of LED cubes, small 3x3x3 cubes, bi-colour, RGB and mono cubes, amazing 16 x 16 x 16 RGB cubes. However, very few show you how to make one and provide the firmware. The cube described on this page uses a 5 x 5 x 5 matrix of single colour LEDs. This is a good size to experiment with as the number of LEDs required at 125 keeps the cost down, doesn't take too long to assemble and just fits onto a eurocard sized PCB. The power requirement is under 1 amp and the use of just one colour keeps both the hardware construction and control software fairly simple. The project includes a ready to program HEX file with some demo cube animations and also the source code. The firmware implements a simple macro drawing processor command set so if you've got some programming skills you can create your own animations for the cube.

Although the project on this page uses a PCB, the original prototype (see below) was constructed on a prototype pad board so if you're not able to make your own PCB it's still possible to make this project yourself. (we've now had some PCB's manufactured - you can buy one from the online shop )

prototype controller

prototype controllers and LED cube

Underside of prototype LED cube

All lit up; orange 3mm LEDs

LED Cube running latest ledcubeC3.hex firmware showing all 28 animations

Schematic

Download schematic in PDF

Final PCB version Circuit Description The LED cube is made up from 125 LEDs arranged into 5 layers of 25 LEDs each. The display itself is multiplexed so instead of requiring 125 connections it requires one to each of the five layers and 25 to each LED in a layer making a total of 30. The cube is refreshed by a software interrupt routine with each layer active for 2ms, so the entire cube is refreshed every 10mS (100Hz). This results in a display with no visible flicker. Only 8 I/O lines are needed to control the LED drivers for the cube which allows a tiny 14 pin PIC16F688 microcontroller to control the whole cube. This micro has an internal 8Mhz clock and 4Kwords of program memory. Each of the LED layers is arranged in a 5 x 5 matrix and controlled by a transistor in an emitter follower configuration connected to the LED anodes. When the respective layer control output from the PIC goes high the base of the transistor is held at +5V and the emitter sits approximately 0.7 volts below this. The transistors used are BC637 NPN transistors, if an alternative is used it should be of similar specification, have an Ic rating of at least 1 amp and check the pin out. The cathodes of the LEDs are connected to IC2 & IC3. These are STP16CP05 low voltage 16-bit constant current sink drivers. The LED current is set by a single resistor connected to the RSET input of the IC (pin 23). The 680R resistor gives a LED current of ~28mA; this resistor can be altered to vary the current supplied to the LEDs ( consult the datasheet before altering the value of this resistor). The LED driver supplied in the 555FSK kit available from the PIC projects store uses the alternative CAT4016 LED driver. This part uses a different ratio for the current mirror that is used to set the LED current. From 08/10/2009 the RSET resistors supplied with the kit are 1K8. If you want to alter the LED current it is calculated as Iled = 50 x (1.2 / RSET) This gives a LED current of ~ 33mA and a total current with all LEDs on of 830mA. I don't recommend going above this with the design as shown.

One layer of the cube

One column of the LED cube

The advantage of using a constant current sink driver IC's is that almost any LED can be used and the supply current remains constant regardless of the LED forward voltage. If the output current does need to be altered, it only requires the current setting resistor on the two drivers to be changed. The outputs of the current sink drivers are controlled by data loaded into the driver IC over a serial input. The two driver ICs are cascaded so the PIC simply clocks in 25 bits of data to control the LEDs in each layer then sets the respective layer driver output high. The board uses the SOIC package variant of the STP16CP05 but this part is available in PDIP package (see here for more info) The six capacitors (3 x 100nF & 3 x 10uF) provide power supply decoupling. C4 and C5 in particular are important and should be tantalum bead types located close to the Vdd power pin of the two driver ICs If you are building the LED Cube from the schematic place a 10uF and 100nF capacitor close to the Vdd power pin of each of the three IC's in the circuit. You have then used all six capacitors shown on the schematic and placed them where they are needed. Diode D1 allows the PIC programmer when attached to J1 (ICSP header) to detect power on the target board while preventing it from actually powering the target. Depending on your particular programmer this diode may be omitted altogether, but if in doubt fit it. The power LED is not critical, you can use almost any 3mm LED for this, or omit it altogether if you don't want a power indicator.

Pin header JP2 provide +5volt and Gnd connections and also brings out the PIC I/O port pins RA4 and RA5. RA4 is also connected to the switch S1 on the PCB. These are made available for those of you who want to add additional features to the software. Power to the circuit is provided through the DC input jack J1. This should be connected to a 5 volt regulated power supply capable of supplying at least 1.5 amp. The power supply should also be able to maintain regulation while the load switches between 15mA to around 700ma every 2mS, all the plug-top style ones in my workshop work fine but if you have problems this is something to check. The J1 (ICSP header) allows in-circuit programming of the PIC microcontroller. It will work with the genuine Microchip PICKit2 programmer and I've also tested with several clone versions of the PICkit2. I don't test with any other types of programmer. PCB Layout

Download PCB artwork in PDF

Download Overlay in PDF Download Overlay (mirrored)

The circuit has been designed to fit onto a single sided 160mm x 100mm eurocard size PCB. The single sided design makes home production of the PCB straightforward. To make it even easier, you can now buy the PCB or short kit containing all the parts except for the main cube body LEDs from the on-line store

Component List You can buy all the parts needed to build this project from most component suppliers world wide. In the UK you can get everything except the 16F688 from Rapid Online and I've included a parts list with their part numbers below. You can also buy a kit of parts from the Online-Store What LEDs to use

The overall effect of the LED cube can vary enormously, so choosing and using the right type of LEDs is important. This section gives some tips and suggestions on the type of LEDs to use. For the main cube LEDs you can use virtually any 5mm or 3mm LEDs you want. Some LEDs are better suited for use in a cube than others so here are some tips. In my opinion the cubes made with 3mm LEDs in diffused packages work best, there is more space within the cube body which makes it visually more effective and the diffused body distributes the light better. Water clear packaged LEDs are not very effective since the LED illuminates the one directly above it. High brightness LEDs are even worse in this respect and LEDs with 15o viewing angle are hopeless in my experience. LEDs with outputs around 50-150mcd seem to work quite well. If you can get LEDs in a milky white diffused package these are ideal, however they are generally not that easy to find. If you have LEDs in a clear package you can diffuse them using Plasti-Kote Glass Frosting spray. This works quite well but don't spray the LEDs until they've been assembled in the jig otherwise the jig rubs the coating off the side of the LEDs. One difficulty I've found is that you can find two different LEDs that on spec' appear to have similar light output, but when you compare them in use one is much brighter. Therefore if you can it's worth experimenting with different LEDs before assembling an entire cube. You can put together eight LEDs in to a 2 x 2 x 2 cube; connect it into one corner of the driver PCB to get an idea of whether a particular LED is going to work effectively. Finally, the cube needs 125 LEDs, buy a couple of extra ones so you have spares in case you get a faulty one, lose one etc. You can try a cube with either of the LEDs below which are available from RapidOnline, alternative colours are available, check the website, but these were a reasonable specification vs. price. Also check out sellers on e-Bay for cheap LEDs. (The 3mm orange LEDs used on the cube in the top video came from http://stores.ebay.co.uk/component-shop, item is ORANGE Standard 3mm LEDs Pack of 50 ) L-7104YD MINIATURE 3MM PURE ORANGE LED (RC) Part No 55-0097 L-7113ID LED 5MM RED DIFF 45MCD (RC) Part No 55-0155

All Rapid parts/descriptions correct at 23-February 2009. You should check part# and descriptions are correct when ordering in case I've made a mistake transferring them onto this page. Component R1,2 (order 1 pack) Description PK 100 680R 0.25W CF RESISTOR (RC) Part # 62-0366

(see note 2 below) R3 (order 1 pack) R4 (order 1 pack) C1,2,3 C4,5,6 Cube LEDs (order 125+) D1 (see note 1) Q1,2,3,4,5 * IC1** IC2,3 (see note 2) LED1 socket for IC1 J1 JP1 (see note 1) JP2 (see note 1) S1 LED matrix sockets Power supply PACK 100 10K 0.25W CF RESISTOR (RC) PK 100 270R 0.25W CF RESISTOR (RC) 100N 2.5MM X7R DIELEC.CERAMIC (RC) 10UF 10V TANTALUM BEAD 5MM (RC) 62-0394 62-0356 08-1015 11-0624

see text above BAT85 SCHOTTKY DIODE 30V DO-34 (RC) BC635 TRAN NPN 45V 1A TO92 TRUSEMI RC PIC16F688-I/P MICROCONTROLLER (RC) STP16CP05M SO24 16 BIT LED DRIVER (RC) See below for alternative parts L-7104GD MINIATURE 3MM GREEN LED (RC) 14 PIN 0.3IN DIL SKT (RC) ALSO 22-0132 2.1 PCB DC POWER SOCKET (RC) 5 WAY R/A SINGLE ROW PLUG (RC) 4 W SINGLE ROW PCB HEADER PLUG RC 32 WAY TURNED PIN SIL SOCKET(RC) 5V 1.5A MINI PLUGTOP SW MODE PSU RC

47-3108 81-0075 n/a (see below) 82-0125 55-0105 22-0155 20-0970 22-0710 22-0505 22-1703 85-2955

TACTILE SWITCH 6X6MM HEIGHT 5MM (RC) 78-0621

note 1: JP1, JP2 and D1 are not required to build a working LED cube. These parts are not supplied in the kit. * You can use BC635, BC637 or BC639 interchangeably for the transistors Q1-Q5. Whichever is cheapest / easiest to source. ** Rapid Online don't stock the 16F688 but you can buy it from Farnell, part # 9760563 , 8BIT FLASH MCU, 16F688, DIP14. You can also buy a pre-programmed 16F688 from the Picprojects online shop. note 2: Alternatives parts to the STP16CP05 The LED Cube kit 555FSK is supplied with the Catalyst Semiconductor (ON Semiconductor) CAT4016W-T1 part.

The CAT4016 uses a different current setting ratio to the STP16CP05 so you MUST use 1K8 resistors instead of the 680R shown on the schematic. The kit #555FSK is supplied with the required 1K8 resistors. CAT4016W-T1 is available from Farnell, order code 1656115 If you want to build the driver on prototype board Farnell sell the PDIP version of the STP16CP05, part # 1292453, Allegro Microsystems make the A6276 which based on spec' appears to be a pin compatible alternative to the STP16CP05 and is also available in PDIP and SOIC packages. Other equivalents based on spec' are Toshiba TB62726AFNA and Macroblock MBI5025 (based on spec' means I've read the datasheets and they appear equivalent but I haven't constructed a cube using any of these alternatives)

Power Supply Mishaps We've sold lots of kits for the LED cube and on the whole there have been no problems getting the kit to work. However, a number of times now people have connected the wrong power supply to the board, in several cases they had it working with the correct 5 volt power supply but they have just picked up the wrong PSU by mistake and damaged a working board. I've done it myself so I speak from experience. Tip. Put some tape or other marking on the end of the power jack lead to make it stand out from all the other DC power jacks you may have around. This will help avoid picking the wrong one by mistake. The original board design does not have protection for over-voltage or reverse supply connection. Any voltage above 5 volts, or a reversed power connection will destroy components on the board. The CAT4016 drivers chips IC2/3 are the most likely to fail. If the voltage applied is >10 volts it will damage or destroy the tantalum capacitors C4/5/6 If one shows visible signs of damage, replace all of them. The PIC microcontroller is a little more robust and may well survive a few seconds, but given a high enough voltage or long enough and it too will fail.

Because the PIC microcontroller has input protection diodes connected to the power rails, the board may actually survive a reversed power connection. This does however depend on the power supply and the length of time it's connected so expect the worst. Finally, if you do have a power supply accident, contact us and we can sort out replacement components for you at a very reasonable cost.

Construction photos: Soldering the surface mount parts and assembling the LEDs into a cube are not jobs for a novice electronic kit builder, don't attempt this project unless you are confident of your ability and have the necessary skills and equipment. Whatever your ability level please take time to read through this section once before starting construction and refer to it again during construction. You are also advised to refer to theschematic diagram.

Assembly is in two stages; control PCB and LED cube. It's easiest to assemble the LEDs into a cube using the PCB to hold it in place so I suggest the PCB is assembled first. 1. The controller PCB 2. The LED cube Assembling the controller PCB
Fig.1 Fig .2 Fig. 3

Fig. 1 Check the PCB to make sure all the holes have been drilled, and look for any etching faults, bridges, breaks etc. before commencing with the assembly. When you're trimming the excess leads from components and link wires DO NOT lift or twist the side cutters as you make the cut. If you do there is a risk the copper PCB track will break at the edge of the solder joint. It's very difficult to see at the joint but it's a common cause of faults. If it does happen it's easy to repair, just scrape off 3mm of the solder resist from the track as it meets the joint and bridge with solder. Fig. 2 The design has deliberately been kept to a single sided PCB, however this has meant 16 wire links are needed to interconnect tracks on the copper side. You should start by installing these wires. Fig. 3 The PCB supplied in the kit is a professionally manufactured board with screen print and solder resist mask. The silk screen overlay for the PCB doesn't show the location of the 16 link wires. The location of the links is indicated by the yellow lines overlayed on the photo. (download PDF version of this image )
Fig.4 Fig .5 Fig. 6

Fig. 4/5 Snap the SIL socket in to individual pins (use a knife) and then solder one in to each of the 25 LED holes and 5 layer drive connections. (you can of course solder the LEDs of the cube directly to the PCB, however it makes repair and removal of the cube difficult should you have a fault or wish to swap cubes) (The kit includes a 32 way SIL socket strip, you only need 30 so you have two spare) Fig. 6 Install the resistors. Colour value bands on the resistor body are: R1/R2 are 1K8 (brown-grey-black-brown-brown) R3 is 10K (brown-black-orange-gold) R4 is 270R (red-violet-brown-gold) The Short Cube kit includes two 1K8 resistors for R1/R2 for use the the CAT4016 LED driver IC's. D1 is not included as it is not required to build the working cube from the kit.
Fig.7 Fig .8 Fig. 9

Fig. 7 Install the capacitors. Note that the Tantalum capacitors C4/5/6 must be fitted the correct way round. There will normally be a vertical line and/or '+' symbol on body of the capacitor above the positive lead and one lead is normally longer than the other; the long lead is the '+' positive lead. Fig. 8 Install the 5 transistors, again ensuring they are positioned as shown on the overlay. Fig. 9 Finish the upper side of the PCB by installing the LED, switch, pin headers and sockets. When installing the LED fit the cathode lead into the hole marked 'Ca' on the PCB. The LED cathode lead is the shorter of the two leads. At this point, apply 5 volts to the DC input jack and take note of the following:

1. The DC jack requires a centre +ve input connection. As there is no reverse polarity

protection on the board you must ensure the power supply connector is correctly wired or you will destroy components on the board. 2. You must use a 5 volt regulated DC power supply. Use a multimeter to ensure there is nominal 5 volts (4.8 volts to 5.25 volts) present between pins 1 and 14 of the IC1 socket. If not find the fault and correct it before proceeding.
Fig.10 Fig .11 Fig. 12

Fig. 10/11

Views of the assembled PCB from different angles.

Fig. 12 Note the polarity marking on the Tantalum capacitor C5. Also the orientation of the PIC16F688.
Fig.13 Fig.14 Fig.15

Fig.13 You should now tin with solder the PCB tracks that carry the 5 volt supply and the connections from the transistors to the layer connector pins as shown in this photo. On the PCB supplied with the kit, the wide tracks without the green solder mask over them all need tinning. You only need a thin layer of solder. Fig. 14 Now install IC2/3 to the copper side of the PCB. You must ensure the IC is fitted the correct way round. The photo shows a small dimple on the top of the IC package (bottom left). This denotes pin 1. (The LED cube kit is supplied with the alternative CAT4016 LED driver) Carefully align and centre the package over the solder pads, then solder the corner lead on one side. Check the package is still aligned and then solder the opposite corner on the other side of the package. If it's still aligned, proceed to solder the remaining leads. Repeat this with the second IC. Check there are no solder bridges between any of the leads. If you do get a bridge use some solder wick (copper braid) to remove it.

Tip: I solder SMD parts with a 0.8mm chisel bit and 22swg solder; 18swg solder and/or a larger bit are much more likely to lead to bridges and shorts. With care you can easily solder each pin individually and make a neat, clean job of it. The PCB you can buy from the online store has a solder resist mask which greatly reduces the chances of bridging, though you still need to take care. You may have read elsewhere a technique for soldering the surface mount parts where a large soldering iron bit is used to cover all the pins in lots of solder then the excess is removed using solder wick or some other method. DON'T DO THIS. Fig. 15 Once both ICs have been soldered in to place you should give the copper side of the board a thorough visual inspection to check for solder bridges between pads and tracks. It's a good idea to spray the copper side of the PCB with a conformal coating once assembly is complete to protect against corrosion. If you've bought the PCB for this project from the online store it already has a protective coating so this isn't necessary. Install PCB standoff or spacers into the four mounting holes at the corners of the PCB. These should provide enough clearance to ensure the board isn't resting on the two Surface Mount ICs. You should also install the PIC16F688 into the IC1 socket at this point making sure it is fitted the correct way round.

Power Supply WARNING: You must use a 5 volt regulated power supply. Connect a 5 volt, 1.0 amp power supply to the DC power input jack J1. The DC jack requires a centre +ve input connection. The power supply should be rated for 1 amp or greater, i.e. 1.5 amp would also be fine to use but 0.5 amp isn't. The power LED1 should light. Measure the voltage between pins 1 and 14 of IC1 again to ensure there is 5 volts present. As there is no reverse polarity protection on the board you must ensure the power supply connector is correctly wired or you will damage and destroy the LED driver IC's and other parts. If you apply a higher voltage to the board you will destroy the PIC and driver ICs. While the PIC is easy to swap out, removing the two surface mount ICs will be very difficult and likely to result in damage to the PCB.

Assembling the LED Cube

It takes me about 01h30m to assemble the LEDs in a cube and that doesn't include assembly of the main PCB so you'll want to allow yourself plenty of time. Patience is your friend on this one. IMPORTANT When the LED cube is installed onto the circuit board DO NOT attempt to solder or repair connections within the LED cube while the board has power applied. ALWAYSdisconnect the power before working on the LED cube. If you accidentaly short an anode/cathode with power applied there is a high probability that it will destroy a LED driver output in IC2/3. 5mm LEDs 3mm LEDs

To assemble the LEDs into a cube you will need to make a simple jig using a piece of MDF or similar material (see photo right). You can download a PDF template for the jig here. LED Jig template

5mm LED cube


Fig.1 Fig .2 Fig. 3

Fig 1. Carefully bend the leads on each LED as shown. The LED cathode should be cranked out so it is aligned with the side of the LED package. This is more important with 5mm LEDs than 3mm LEDs which have a much narrower package. The anode should be bent to an angle of 90o. Take care bending the leads to avoid stressing them as they enter the LED body. The fig 1. photo should only be used as a reference for forming the leads, not to identify the cathode/anode terminals. Normally the shorter lead is the cathode, but you should verify this before assembling the cube. Fig 2. The LED anodes run horizontally around the jig and are connected together. The LED cathodes are perpendicular to the jig. Install five LEDs into one row of holes as shown. The last LED should have its anode lead bent round so it connects with the LED in the next row. Solder the anode of each LED to the next LED. Fig 3. Using a 5 volt power supply and resistor (anything from 120 to 330 ohms will work), test each LED to make sure it is not faulty or installed with anode/cathode terminals reversed. With a 125 LEDs to assemble getting one the wrong way round as the tedium sets

in is quite likely! WARNING. If you skip this test and get the LEDs assembled into the cube then find an LED isn't working it will be extremely difficult to correct it. IMPORTANT: Only do this test while the LEDs are on the jig. DO NOT attempt to do this testing with the LEDs installed on the circuit board as it may cause damage to the other components.
Fig.4 Fig .5 Fig. 6

Fig 4. Install LEDs into the next row and solder their anodes together. Fig 5/6. Connect the anode terminal of the right most LED to the LED in the next row. You will also have the anode lead from the LED to the left meeting at this point. Solder all three leads together as shown making sure the lead from the LED on the previous row clears the vertical cathode lead.
Fig.7 Fig .8 Fig. 9

Fig 7. Continue to install LEDs in to each of the rows, soldering and testing as you go. Fig 8. With all five rows completed solder a wire across all the rows to hold the layer in shape. This wire also serves as an electrical connection. Note how the wire goes over-andunder the LED anode leads. Carefully remove the assembled layer from the jig and put to one side. Repeat the previous steps for each of the five layers.
Fig.10 Fig .11 Fig. 12

(1280 x 960 resolution)

Fig 9-12. These pictures show the general arrangement of the LED cube. Assemble the cube by inserting the cathode leads of the first LED layer into the sockets on the PCB. Next attach the second layer to the first. The best way to do this is lie the PCB on its side. Solder the four corner LEDs of the second layer to the first layer. With the four corners soldered, put the PCB flat on the work surface. Next work around the outside of the cube soldering the two layers together. Then work your way in to the middle of the cube soldering each LED to the one below. It's a bit fiddly getting into the middle of the cube but not impossible. I strongly advise that you do not solder the bottom LEDs into the sockets on the PCB. The reason for using the sockets is to make it easy to remove the LEDs from the PCB if you need to repair it. All the time keep looking across the LEDs from several directions to ensure the LEDs in the upper layer are level and aligned with those in the layer below; make any adjustments as needed. If you don't keep the layers level as you go the whole cube will be distorted by the time you get to the very top layer. Repeat this until all five layers are connected together to form the cube.

Fig.13

Fig 13. Once all the layers are in place attach the five wires to the layer drive sockets as shown in the photo. Ensure the wires do not short on each other as they rise up through the cube. The sockets are spaced apart on the PCB to help with this. The connections are labeled L1 to L5, L1 being the lowest layer, L5 being the top. Once the cube is installed on the PCB and all connections have been made, take a good look

over the cube assembly to make sure no leads have got bent and are now shorting out against one another. Failure to do this is a sure way to damage the LED driver ICs.

Important Cube Assembly info' or HOW TO AVOID FIRST TIME DISAPPOINTMENT added December 2010 Please read this. Several hundred LED cube kits have been sold now and very few customers have problems with them. However in a handful of cases there is a common problem; that is one or both CAT4016 LED drivers have a failed output(s). The most probable cause for this is that at some point there has been a short circuit between the column and layer drive wires somewhere in the cube while it was powered on. When assembling the layers into a cube and also when attaching the LED cube assembly to the PCB it is easy for a short to occur since the clearance between the wires is very small where the LEDs interconnect (see photo below) Therefore it is essential to: 1. Take care during assembly; the cube is easily deformed so be very gentle with it. 2. Do not attempt to solder, tweak the wires or touch the cube assembly when it is powered on - ever. 3. Before powering up for the first time check, check and check again for wires that are shorting together. If you don't find them now, they will show themselves up once you apply power and then it will be too late! If the output of the driver IC does get shorted directly to the layer wiring it is likely to be damaged faster than you can blink so even the briefest accidental short will most likely damage it. If you bought the kit 555FSK from Picprojects and you do find you have damaged the

CAT4016 contact us and we will replace one pair of CAT4016 drivers F.O.C. (free-of-charge) one time only - can't say fairer than that. When all the LEDs in a column remain on all the time it indicates that either: There is a short to ground on that column connection - unlikely the output from the CAT4016 LED driver IC connected to that column has failed short-circuit.

If none of the LEDs in a single column light it indicates that either the output from the CAT4016 LED driver is: not connected to the column - wiring fault there is a short circuit between the column and one or more of the layer drive wires the output from the CAT4016 LED driver as failed open circuit

See Troubleshooting section below Example of cube constructed with 3mm amber LEDs. To construct the cube with 3mm LEDs a second template was printed and then fixed to the 5mm jig with an offset. This was then drilled with 3mm holes to make a single jig that can be used for assembling both 3mm and 5mm cubes. In practice the body of most 3mm LEDs seems to be about 2.9mm or less so the LED sits a bit lose in 3mm hole. You might want to drill at 2.5mm and ream the holes out, frankly I couldn't be bothered but it is easier to solder it altogether if the LED body is held by the jig.

5mm Cube with green LEDs

Troubleshooting Hundreds of LED cube kits have been sold and very few people contact me with problems. However, it is quite a technical kit to assemble and the surface mount driver chips (IC2/3) can be tricky to solder. The information in this section is put together from issues that have come to my attention from end users. To help troubleshoot problems I've added a diagnostic function to the the LED cube firmware. All firmware versions from 1.0.3 (filename LEDcubeC2.hex) will contain this feature. Any kit or preprogrammed chip sold after 31-09-2010 has this code. The diagnostic routine changes the signals between the PIC and the two driver ICs very slowly. This allows checking of the signals to see that they are present at all the correct pins of the ICs using a simple LED and resistor as a test probe. Enabling Diagnostic Mode The diagnostic mode is enabled by grounding pin 2 (RA5) of IC1. Since the pin is brought out on the JP2 header the easiest way to ground the input is to fit a jumper wire as shown in the photo (right). When the board is powered up, if the jumper is present the firmware will run the diagnostic code. This first clears the the shift registers in driver chips IC2/3 so no LEDs should be on. It then clocks a high level in to the first shift register (IC2) which lights LED 25. Clock and latch signals are then generated at about 2Hz and the LED 'walks' from LED25 to LED1, when it reaches LED1, it goes back to LED25, at the same time switching to the next layer up. When it reaches LED1 in layer five it goes back to LED25 in layer one and repeats. Simple Test Probe The presence of the signals can be checked using a simple LED and resistor as shown in the photo. With the diagnostic jumper fitted a good place to attach the LED cathode is directly on the jumper since this connects to ground. A spare LED from the cube can be used but any LED will do. For the resistor use any value from 150R up to about 1K0.

Video showing diagnostic mode running #1 cause of failed LED driver ICs is shorting out the two terminals of an LED in the cube. This can happen when fitting the cube to the PCB, while making final adjustments to the shape of the cube while it's running, or trying to solder the LEDs while it's running. If a column of LEDs stays ON when the cube is running, (in diagnostic mode a single LED) then either there is a short to ground on that signal or the more likely cause is that the output from the driver IC has failed so it is permanently turned on. In this case the driver IC will need replacing. If a column of LEDs stays OFF when the cube is running, (in diagnostic mode a single LED) then either there is a break in the track to that LED column or the output from the driver IC has failed so it is permanently turned off. In this case the driver IC will need replacing. If you think you have a failed driver IC contact Picprojects by email for assistance. LED Columns 25-10 are driven by CAT4016 driver IC2 LED Columns 9-1 are driven by CAT4016 driver IC3 If LEDs 25-10 or 9-1 are either all on or all off then the likely cause is a broken connection on either the SIN, CLK or LATCH signals between the PIC and the driver ICs or the two driver ICs themselves. This should be easy to locate using the diagnostic mode. If just a single LED in the cube stays off all the time then it's likely to be either a failed LED, LED not soldered to the rest of the cube or LED installed with the cathode/anode wrong way round (you did test for this during assembly of the cube didn't you?) Common cause of breaks in the track is mentioned in the construction section. When link wires or excess leads are trimmed during assembly, twisting the side cutters or pulling up on them as the cut is made can break the copper track at the edge of the solder joint. To repair it just scrape back 3mm of solder resist and bridge with solder.

Operation These notes apply to the the latest firmware version, ledcubeC3.HEX released 15/01/2011 The LED cube runs as a standalone device. The latest firmware can operate in one of two modes:

By default it will run the animation sequences in random order. Pressing and holding switch S1 as the LED cube is powered on selects the sequential mode. The animations are run sequentially in a continuous loop.

In either mode immediately after power-on the LED Cube displays the text 'PICPROJECTS' followed by the firmware version (currently C3) before continuing in the selected mode. To modify or develop your own animation effects you will need to modify the source code, reassemble it and reprogram the PIC using a separate PIC programmer. Details for the drawing processor can be found here Changing the startup text display If you want to personalise the text that it displays at startup, here's how. You will need: The free MPLAB IDE software installed on your computer. and using MPLAB can be found here. A PIC Programmer hardware device e.g. Microchip PICkit2 A short guide to downloading

Download the ledCubeC.zip file from thefirmware section below and put all the files into a directory on your computer. Open the files ledCubeC.asm and CubeProgram.inc Find the section in the CubeProgram.inc file shown in the screen dump right. Each character is animated using two instructions, for example the letter 'P' is done using these two instructions. LDR R0, 'P' JSR WRITE To change the text simply edit the file, changing the characters; you can add or remove the LDR/JSR instruction pairs if you need more or less characters. LDR RZ,4 MSET LDR R0, 'H' JSR WRITE LDR R0, 'E' JSR WRITE LDR R0, 'L' JSR WRITE LDR R0, 'L' JSR WRITE LDR R0, '0' JSR WRITE RET

In the example above the text 'HELLO' will be animated at start-up instead of 'PICPROJECTS' Once the CubeProgram.inc file has been modified save it. Then select the ledcubeC.asm file and reassemble it. The resulting ledcubeC.HEX file will then need to be programmed into the PIC. You can go back to the original code at anytime by downloading the ledcubeC.HEX file and reprogramming the PIC.

Firmware The HEX file is ready to program directly into a PIC 16F688. The zip file contains the source code which you can modify or just view to see how it works. If you are going to modify the code I recommend you download and install the Microchip MPLAB IDE which will allow you to edit, modify and program the PIC seamlessly. Not got a PIC programmer? Buy a pre-programmed PIC from the on-line shop This is the latest firmware released on 15-01-2011, ledcubeC3.HEX, v1.0.4 Features new to this version: improved random sequence selection two operating modes; random or sequential 5 new animation effects for a total of 28 effects. Filename ledcubeC3.zip, v1.0.4, 15/01/2011 ledcubeC3.HEX, v1.0.4, 15/01/2011 (animations 15/01/2011) ledcubeC3_JB.HEX, v1.0.4, 14/02/2011 (animations 14/02/2011) ZIP file containing new animations Download link download download checksum 0x5B9F download checksum 0xC26B download

Description Source code for 16F688 HEX file ready to program into the PIC (Picprojects original animations) HEX file ready to program into the PIC (Jozef Blaht custom animations) Jozef Blaht animations

Jozef Blaht from Slovakia has been busy creating some new animations effects as well as modifying some of the Picprojects ones. He's made a really good job and I've been impressed enough with them to ask his permission to make them available here. Because of the memory limitations on the PIC16F688 we can't included all the original animations as well as the new ones created by Jozef. Therefore I've provided an alternative HEX download that includes all the animations created by Jozef while losing a few of the original Picprojects ones. In addition to this you can download a ZIP file that contains the new animation effects in separate .TXT files. These can be cut and pasted into a new include file and reassembled to create your own custom mix of animations effects.

Description and programming details for the LED Cube Drawing Processor. If you need a PIC Programmer I strongly recommend the Microchip PICKit 2, this is available from suppliers world wide or direct from Microchip. It's reasonably cheap to buy and reliable.

Das könnte Ihnen auch gefallen