For those who don’t know, PICs are essentialy tiny computers, with built-in internal memory, processor, input/output controllers, comparators and other peripherals packaged inside a single silicon chip.
Last year, on the Microsoft Academic Cell for Robotics of the Federal University of São Carlos, I needed something to introduce our members to the eletronics world. So we decided to begin by using Microchip‘s PICmicro microcontrollers to build simple but functional circuits, a nice way to gather knowledge ranging from basic analog electronics to low-level microcontroller programming in the same time, while also having some fun.
But then, we needed a programmer. Not the person, but the hardware required to store a software program inside the microcontroller in order to instruct it into doing something useful, thus effectively programming the device.
After spending some time googling around for custom-built programmers, and after seeing they were quite simple to design, we decided to build or own as a good starting exercise. We just needed something simple, reliable, that wasn’t too expensive and that could be easily built by students.
Requirements
To keep the budget factor low, we decided on a David Tait‘s design which uses the computer parallel port and a parallel cable as a transmission line. Before designing the device, there were some initial modifications we decided to have in our circuit:
It would run entirely on batteries. Having a separate power supply for the programmer is just asking for more wires around and having more wires around usually equals having more mess on the work desk. Also adding to the fact that power supplies here aren’t so cheap for a student budget, creating a self-powered device was the most suitable option for us.
But since we wanted something simple and cheap, but still reliable and expensible, some extra care was needed, because, if power supplies weren’t cheap, good batteries aren’t either. Efficiency should be a main goal, because if we had to replace batteries everytime, then the savings on the power supply wouldn’t justify the increased cost in the long run.
The Design
To improve efficiency, our circuit uses a schmitt trigger buffer for translating parallel port voltages into TTL-compatible voltages. Also, the proper use of transmission line terminations allows the device to work with longer parallel cables. Actually, I have been using 2m cables myself and didn’t run into any issues yet.
To regulate the unpredictable alkaline voltages down to a nice constant 5v, we also couldn’t rely on a standard linear regulator like the 7805 because it requires at least 7.5v to work properly. In other words, using it would require at least 5 cells with at least 90% of charge left available in our circuit. Too wasteful. In turn, a LDO regulator would be fantastic, as it works with voltages as low as 5.4 volts.
Just for clarification, I couldn’t just plug 4 or 3 cells in series because newly replaced alkaline batteries can source voltages as high as 1.68v per cell rather than they nominal 1.5v, resulting in almost 7v of microcontroller killing voltage. Also, 9v batteries were avoided for their low mAh capacity, as the device should be able to power-up other circuits trough its ICSP connections during programming.
To enter programming mode, most PICs needs a voltage source somewhere around 12v present on the MCLR pin. In the past, however, a real current source was required for EEPROM programming, but for the newer, flash-memory based chips, the current doesn’t actually matters, only the voltage does, as it only purpose is to signal the device to enter programming mode.
Because of the very experimental nature of this project, we sacrified the ability to program EEPROM chips and aimed only for the flash-memory chips (it may work with EEPROMs, but we just haven’t tested it yet). So, if we need a voltage that is almost the triple of our available voltage, but don’t need any actual current, its the perfect scenario for employing a charge pump circuit.
Charge pumps are very efficient voltage converters, but with very finite impedance, they can’t source much current. Those circuits use capacitors a "buckets" to pump charge from one place to another, producing higher voltages at the expense of lower output currents. It didn’t take long before we noticed that Intersil offers free samples of their 7660S "Super voltage converter chips", which is great, although the 7660 family is very popular and available from several manufacturers all around the world.
Nevertheless, we went on and asked Intersil for some of the 7660 samples.
Schematic
All considerations taken into account, below is the final schematic for the device, featuring the LP2950-CZ LDO regulator and the ICL7660 in the "voltage tripler" configuration.
Parts list
Qty | Device (Description) | Value | Parts |
1 | Power Switch | DIP Switch | SW1 |
1 | LED5MM | Green | LED1 |
1 | LED5MM | Red | LED2 |
6 | Small Signal Diode | 1N4148 | D1, D2, D3, D4, D5, D6 |
1 | Resistor (0.25w) | 270 | R17 |
2 | Resistor (0.25w) | 100 | R14, R15 |
2 | Resistor (0.25w) | 1k | R1, R11 |
4 | Resistor (0.25w) | 4k7 | R3, R4, R5, R8 |
9 | Resistor (0.25w) | 10k | R2, R6, R7, R9, R10, R12, R13, R16, R18 |
3 | Ceramic Capacitor | 100nF | C3, C8, C11 |
2 | Ceramic Capacitor | 470pF | C9, C10 |
2 | Eletrolytic Capacitor | 1uF | C1, C2 |
4 | Eletrolytic Capacitor | 10uF | C4, C5, C6, C7 |
2 | Transistor PNP | BC557C | T1, T2 |
1 | Transistor NPN | BC548 | T3 |
1 | Voltage Converter | ICL7660CPA | IC3 |
1 | Schmitt Trigger Inverter | 74HC14N | IC5 |
1 | LDO Voltage Regulator | LP2950CZ-5.0 | IC1 |
1 | SIL Pin Header | 3-way | J2 |
1 | SIL Pin Header | 3-way | J1 |
1 | SIL Socket | 20-way | J3 |
1 | DIL Socket | 18-way | DIL18 |
1 | DIL Socket | 20-way | DIL20 |
1 | Serial Connector | DB9 Female | DB9 |
1 | Parallel Connector | DB25 Female | DB25 |
1 | Battery Clip | 4xAA Cell Holder |
Building
The samples from Intersil arrived only a few weeks later, carefully packed inside a hard plastic box filled with foam, ensuring the chips had some comfort during their long travel overseas.
Well, that box was really too useful to be discarded, so we figured out a nicer destiny for them. At the time I didn’t yet have my fellow Dremel rotary tool, so I just cut its top off with a knife and made some holes on the sides for screwing a DB-25 connector (for the parallel port) and a DB-9 connector (for the ICSP connections). Here are the final pictures of the programmer mounted inside the Intersil’s sample’s box (sorry for the crappy resolution):
Layout
And finally, here is the perfboard (pre-punched circuit board) layout we used for placing components on the box. Please note this layout should not be used for PCBs.
Downloads
All Eagle files can be obtained here. For more information on how to setup a software programmer to work with this hardware, please see the next post, configuring WinPic800.
The Microchip name and logo is a registered trademark of Microchip Technology Incorporated in the U.S.A. and other countries. The schematic presented here is copyright of its original author, licensed under the terms of the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
excelente pero algunas fotos no se ben mi estimado te agrade seria si las buel bes a subir te ante mano gracias
Hola, ya remplace las fotos, gracias por tu interés!
Very interesting post