Herramientas de usuario

Herramientas del sitio


ardpic-circuit

Detalles del circuito para el programador de PIC de 14-bit

Esta página describe el circuito y la construcción del un programador PIC que soporta un gran número de dispositivos PIC de 14 bit comúnes, como PIC16F84, PIC16F84A, PIC16F628A, y PIC12F675.

Otros dispositivos PIC que funcionan fuera de los 5V y 13V de tensión de programación (Vpp) puede también funcionar con algunas modificaciones menores del circuito o a través de un cable adaptador conectado al terminal ISCP. Mire la lista de dispositivos compatibles con un desglose de si el socket ZIF o un cable adaptador ICSP se deben utilizar con cada tipo de dispositivo.

El programador tiene las siguientes características:

* Programación de PICs de 8 y 18 pin usando un zócalo ZIF de 18 pin (el tipo de patillaje es seleccionado con un jumper).

  • Programación serie “In-Circuit” (ICSP) via cable con conector de 6 pines.
  • Control directo de MCLR/VPP, VDD, DATA, y CLOCK a través de los pines de salida de Arduino.
  • Alimentación de 13 volt para la tensión de programación VPP.

El programador PIC está contruido en dos chaquetas construidas una sobre otra, con la tensión de alimentación de 13V en la de abajo y el circuito programador con el zócalo ZIF en la superior. La lista completa de materiales se encuentra al final de esta página. La siguiente foto muestra el programador completamente ensamblado y montado sobre una placa compatible Arduino Uno:

Fuente de alimentación de 13 volt

Esta sección describe un tipo concreto de fuente de alimentación de 13 Voltios que ha sido probada por el autor. Miembros de la comunidad han contribuido con diseños altertativos que también funcionan. Mire esta página para mas información.

Comenzamos con la fuente: En este diseño usaremos una fuente externa de entre 16 y 20 voltios como entrada. Usaremos un regulador común de 12V con un divisor resistivo en la etapa de salida para generar los 13 voltios que necesitamos:

El circuito está construido en una placa de prototipos de Arduino, con todos sus componentes tumbados para que no interfieran con la placa principal que colocaremos encima. Las siguientes fotos muestran la parte superior e inferior de la placa de la fuente: <html><table><tr><td></html> <html></td><td></html> <html></td></table>«/html> Nota: mientras la fuente de alimentación está construida en una chaqueta de prototipos Arduino, no está conectada a los pines de alimentación del Arduino. Ni siquiera el de masa. Así la fuente de alimentación de 13V puede ser alojada fuera del módulo en lugar de en una chaqueta.

Se utilizó un conector monofónico 3,5 mm para auriculares para la entrada de alimentación externa, pegado a la placa de circuito. Podríamos haber utilizado un conector como la toma de corriente de la placa Arduino, pero existe el riesgo de que podamos confundirno y conectar accidentalmente la alimentación externa de alta tensión al Arduino y freírlo. Por tanto, es más seguro de usar un tipo completamente diferente de toma de entrada. El cable de salida de 13 voltios está fijado a la placa de circuito con hilo de nylon.

El regulador de tensión genera un poco de calor: cada voltio de entrada por encima del 16 generará más calor. Sin embargo, el consumo de corriente de la placa base es muy bajo, alrededor de 30 mA, sobre todo para el LED rojo y la fuente de alimentación. Los PIC modernos basados en flash no utilizan los 13 voltios para nada, sino que sólo detectan la tensión elevada y entran en el modo de programación. Los PIC más antiguos sin flash, pueden extraer más energía, por lo que se habrá que prestarles más atención. El aire para refrigeración del regulador debe ser suficiente para los pocos grados de temperatura que se generarán, pero si se siente usted algo paranoico puede entonces agregar un disipador de calor. Pero tenga cuidado con la altura del disipador de calor para que no haga corto contra de la parte inferior de la placa superior. Como alternativa, puede construir toda la fuente y el disipador en una caja separada.

Para el uso de larga duración, se recomienda que la fuente de alimentación externa sea una fuente de alimentación DC de banco (la mayoría de las tiendas de electrónica pueden venderle una fuente de alimentación de banco o un kit para construir la suya propia). Una alternativa es el uso de dos baterías de 9 voltios conectadas en serie para generar una entrada de 18 voltios. Las Baterías de 9 voltios no tienen mucha carga, por lo que sólo son adecuadas para un par de horas de uso. Pero eso puede ser suficiente para un uso ocasional, si solo programa un PIC cada pocas semanas o meses. La conexión en serie entre los dos ganchos de la batería está aislado y se fija dentro de la carcasa del conector:

This design is not the only way that 13 volts could be generated, but it is one of the simplest. A booster circuit or charge pump could be used instead to convert the Arduino's 5 volt supply into 13 volts, but you will need to be careful of current draw. The main reason for the two-board design for the PIC programmer was to provide some flexibility in VPP generation. If you come up with a better method, then swap out the bottom board and you're good to go.

Main programmer circuit board

We now turn our attention to the main circuit board. The circuit has the following features:

JP1 receives the 13 volt VPP input from the power supply board. Red LED that indicates that VPP is available; if the LED is not lit then the programmer will not work. Yellow LED that indicates activity whenever the sketch reads from or writes to the PIC. Transistor Q1 is used to control the VPP supply to the PIC. When the transistor is off (A1 pin is low), 13 volts is applied to the MCLR pin. When the transistor is on (A1 pin is high), the MCLR pin is dragged low and the PIC resets. Arduino output D2 is used to directly control VDD to the PIC so that it can connect 13 volts to MCLR before applying VDD, as described in the PIC programming specifications. When in programming mode, PIC's should only pull a few milliamps, so it should be safe to connect the Arduino output directly to the PIC. JP2 provides a 6-pin ICSP header for connecting to a separate circuit board. Some ICSP connectors are only 5 pins and don't need PGM. PGM was included for boards that support both high-voltage and low-voltage (LVP) programming. PGM is tied to ground to force the use of high-voltage mode. JP3 is used to select 18-pin or 8-pin operation. The jumper shunt should be placed in position 1-2 for 18-pin PIC's like the PIC16F84 and PIC16F628A, or in position 2-3 for 8-pin PIC's like the PIC12F675.

<html><br><br><br><br><br><br><br><br></html> The circuit is built on an Arduino prototyping shield. The following photos show the top and bottom of the main programmer circuit board. The soldering and wiring is a little messy because I made some mistakes in earlier versions of the design and had to correct them (the circuit above is the correct verison):

Modifications may be needed to the circuit for different kinds of PIC's. For example, the PIC16F87 and PIC16F88 have PGM on pin 9 instead of pin 10. You can either modify your shield, or create an adapter cable that plugs into the ICSP header JP2 and remaps the pins appropriately.

ICSP-only programmer

If you don't need the ZIF socket because you are only going to be using ICSP mode, then the circuit can be simplified to the following:

This circuit is simple enough that you may be able to build both the 13 volt power supply and the ICSP programmer onto a single shield if you arrange the components carefully. Because a single shield can be top-most, there is no need to lay the components flat. By standing the capacitors and voltage regulator upright, you will get more space for the other components.

Testing

The most dangerous part of the programmer circuit is the 13 volt supply. If it is accidentally connected to the wrong pin it could fry the Arduino! Before proceeding, make sure you check the two circuit boards carefully with a multimeter to ensure the following:

The positive 13V input should only be connected to the 10K and 1K resistors. The other end of the 1K resistor should only be connected to the anode of the red LED, with the cathode connected to ground. The other end of the 10K resistor should only be connected to the collector of transistor Q1, pin 4 of the ZIF socket, and pin 1 of the ICSP header. There is no short anywhere in the circuit between +13V and ground. Check the circuit boards for bridged tracks or other problems. If the leg of a resistor crosses the 5V or GND rail, and isn't supposed to be connected to the rail, then make sure there is sufficient clearance to not short out against the rail. This especially applies to the 4.7K resistors on pin 10 of the ZIF socket and the base of Q1. With the power supply board disconnected from the Arduino and the main circuit board, apply external power and check that its output is 13 volts. Next, plug the two boards into the Arduino but do not connect the external power supply or put a PIC in the ZIF socket yet. Upload the ProgramPIC sketch to the Arduino, launch the Arduino IDE's Serial Monitor, and set the line endings to “Newline”.

In the monitor window, type the command PROGRAM_PIC_VERSION (in upper or lower case). If all is well, you should see ProgramPIC 1.0. Next, try the HELP and DEVICES commands. When you issue these commands, the yellow LED should blink briefly. This will verify that the sketch is functioning at a minimal level.

The next step is to attach the external power supply and connect the power supply board to the main board. This is the moment of truth. The red LED should light indicating that VPP is active on the main board.

Place a blank PIC in the ZIF socket (a PIC16F628A is recommended), and launch the Serial Monitor again. This time issue the DEVICE command and you should see something like the following:

 OK
 DeviceID: 1066
 DeviceName: pic16f628a
 ProgramRange: 0000-07FF
 ConfigRange: 2000-2007
 DataRange: 2100-217F
 ConfigWord: 3FFF
 .

Some of the details may be different depending upon the type of PIC you have inserted into the ZIF socket. If you get “ERROR”, then there is probably something wrong with the connections on the main board or the jumper shunt on JP3 is in the wrong position. Disconnect all power, inspect the connections on both boards, and try again.

You should now have a working PIC programmer:

Parts list

Semiconductors:

1 x 3mm red LED 1 x 3mm yellow LED 1 x BC548 or equivalent bi-polar NPN transistor 1 x 7812 voltage regulator 1 x IN4004 diode Resistors:

1 x 68 ohm resistor 1 x 220 ohm resistor 2 x 1K ohm resistor 2 x 4.7K ohm resistor 1 x 10K ohm resistor Capacitors:

1 x 33uF electrolytic capacitor, rated for at least 25 volts 1 x 0.22uF greencap capacitor 1 x 0.1uF greencap capacitor 1 x 100nF ceramic capacitor Other:

2 x prototyping shield circuit boards 1 x 18-pin ZIF socket 1 x 2-pin header socket for 13 volt input to main board 1 x 2-pin header plug for 13 volt output from power supply board 1 x 3-pin terminal strip for selecting 8-pin vs 18-pin operation 1 x 6-pin header socket for ICSP 1 x jumper shunt 2 x 6 pin terminal strip 2 x 8 pin terminal strip 2 x 6 pin stackable header 2 x 8 pin stackable header 1 x 3.5mm monophonic headphone jack 1 x momentary push button for Arduino reset External battery-based power supply (optional):

1 x 3.5mm monophonic headphone plug 2 x 9 volt battery clips 2 x 9 volt batteries

ardpic-circuit.txt · Última modificación: 2013/05/22 14:55 por 127.0.0.1