ساده ترین پروگرامر PIC

ROBOTICS

کاربر فعال مهندسی رباتیک
ساده ترین پروگرامر PIC







his is a very simple in-circuit-serial-programming (ICSP) solution for PICs capable of so called low-voltage-programming (LVP). All you need are some resistors and a 9pin (or 25pin) SUB-D connector. Because of that few parts, you can build them into the sub-d housing or you might think about integrating them into your final device where your PIC will have to go to work. Doing so, you can easily perform software updates when needed.

But you can use it for programming only, too. For reading and writing, you have to apply power (+5V at Vdd) and tie MCLR to high level (Vdd) (Microchip suggests to use a resistor for MCLR because of latch-up risk). An oscillator circuit doesn't have to be connected. Of course, also connect the three lines PGD, PGC and PGM.
lvpc

LVP-mode is enabled by a high level on pin PGM. The second 10k resistor at PGM pulls this pin to ground and thus safely prevents the PIC from entering LVP-mode if no PC is connected, although this resistor is not necessary. So if you either always stay connected to a PC or only want to programm the device here, you won't need it. But if you want to programm your PIC in-circuit, that means while it is remaining in its circuit, it's nice to safely prevent the PIC from entering programming mode when he should do his work.

Since you use Low Voltage Programming-mode, pin PGM is not usable for I/O. If you programm a PIC in this manner for use in any circuit, always ensure PGM is pulled low (e.g. by adding 10K to ground) even if the schematics look different - otherwise it might not enter normal working mode.

All the PIC's I/O-pins are protected against electric discharge by internal diodes to Vss and Vdd (see datasheet!). With a resistor limiting pin current, all voltages will get clamped between 0V and 5V.

Note that this circuit might not work on non-legacy serial ports! Only voltage levels of +0V and +5V are sent back to PC instead of -10V and +10V. This works well on my desktop-PCs having a serial high-low trigger voltage of about +2V. But my notebook connecting by an USB-serial-adapter don't cooperate with this circuit...

For programming, you can use ICProg from Bonny Gijzen. Configure as JDM-type-programmer (by reducing the setting of I/O-Delay you can speed up programming but increase the risk of errors).

The next picture shows a PIC16F870 ready for programming. The 10k against ground at Pin 3 of the Sub-D-Connector has been omitted (see above). For pulling up MCLR, a resistor connects PIC's Pin 1 to +5V.

Ok, I must admit, this is not the finest way to get a PIC written but a very simply one. And well, finally that's what it's about here..​
 

Similar threads

بالا