I write this portion of the document after successfully winning my first battle with the PICs. I managed to build a programmer for the PIC16F84 and write some pre-built code to it. I then tested it out with a simple circuit, and voila, it worked. In my search for enlightenment, I found the PICLIST site quite useful. Check out their beginner's checklist. Here are the steps I used to get going:
1. Pin 4 to +5V (MCLR normal operating setting) 2. Pin 5 to GND 3. Pin 6 to 220 Ohm resistor (1/4 watt, 5%). 4. Other end of resistor to positive side of LED. (Negative side of regular led is flat) 5. The negative side of the LED was connected to GND. 6. For the clock, I got a ceramic resonator. I recommend the ones with capacitors built in. I got a 4MHz one (CST4.00MGW) and it works well. The two sides of the resonator were connected to the two OSC pins on the PIC (Pins 15 and 16). The middle pin on the resonator was connected to GND. 7. Pin 14 was connected to +5V and a .1UF monolythic ceramic capacitor was placed between Pin 14 and GND.
After I had that set up, I plugged it in and the led blinked! Hurray!
I started out with the 84flash.asm file (from the above mentioned archive). I quickly discovered that gpasm is picky about tab placement in files. I ended up with the following file for my PIC16F84A. The hex code it generated was no different from the original .hex file. This was something of a reassurance to me. I then modified the code to use a different pin to blink by changing the LED_pin from 0 to 3.
It may be useful to note that these .asm and .hex files generate warnings. As far as I know the warnings may be disregarded. They haven't caused me any noticeable problems.
Another successful battle. Next I shall attempt to battle the evil PIC16F877.
After a bit of messing around, I have finally managed to program and reprogram the PIC16F877 chip. First, the NOPPP hardware needs slight modification.
The following modifications allow the NOPPP to program the 28 and 40 pin 16F87x family of PICs. The only extra hardware you will need is a 40 pin ZIF socket and a resistor. Connect the 40 pin socket to the 18 pin socket as follows:
18 pin Signal 40 pin ====== ====== ====== 4 MCLR 1 5 VSS 31 12 RB6 39 13 RB7 40 14 VDD 32 Additionally, connect pin 36 (RB3/LVP) via a 1k-10k resistor to GND.
The original Blondini modification did nothing with RB3. However, based on this information, I chose to ground the RB3 pin via a 2.2k resistor. Any value from 1k to 10k should be okay. If you want to learn about unused/floating pins in general, take a look at this page.
The modifications match the pinouts of the 16F873, 16F874, 16F876, and 16F877. I haven't checked the 16F870 or the 16F871, but I imagine they might work as well. With the 28 pin chips, you will need to insert pin 1 of the chip into pin 1 of the socket. 18 pin PICs will not work in the 40 pin socket. Additionally, do not attempt to have PICs in both sockets simultaneously.
As for software, Blondini released a nicely modified version in the file noppp_V0.3.tar.gz. Thanks to the many people, including Blondini, who wrote in to notify me that the Blondini's PIC Page returned. I haven't tried it, but the software promises the following features:
I have a funky little movie of the PICs in action that you might want to download if you happen to have a broadband connection.
Once you have a 5V regulated power supply, you can wire up the test circuit as follows:
1. Pin 1 (MCLR) to +5V 2. Pin 11 (VDD) to +5V 3. Pin 12 (VSS) to GND 4. Pins 13 & 14 to side pins on ceramic resonator 5. Middle pin on ceramic resonator to GND 6. Pin 36 to GND via a 2.2k (1k-10k) resistor. This prevents the chip from entering Low Voltage programming mode, since the bit may still be set. If you turn off the LVP config bit, you don't need this. 7. Pin 32 to +5V 8. Connect a .1uf capacitor between Pin 32 and GND. It's best to be as close to the chip as possible. 9. Pin 31 to GND 10. Pin 23 to 220 ohm resistor (up to 1k should be ok). 11. Other side of resistor to the anode (positive side) of a LED. The negative side is called the cathode and sometimes has a little flat spot on it. The lead for the anode is sometimes longer. 12. Connected the LED cathode to GND.
The source file for this test circuit is first.asm. It can be compiled with gpasm into a useable .hex file. You may need to change the capitalization of the file in the include statement.
Return to Home Page