K149a
Transcript of K149a
K149 USB PICmicro® Programmer DIY Electronics (HK) Ltd PO Box 88458, Sham Shui Po, Hong Kong http://www.kitsrus.com mailto: [email protected]
Last Modified March 28 2003
Board Construction
The board is quite easy to construct and it is advisable to read through thesenotes before starting. The USB chip is quite tiny and should be mounted on theunderside of the PCB ready for use.
WARNING
Be aware that the premounted USB chip is sensitive to static electricity dischargeand could be damaged by mishandling of the PCB. Be careful with the board andavoid touching any of the tracks or pads while assembling it. Try to handle it onlyby the edges.
Other chips in this kit are also sensitive to static discharge. These are thePIC16F628 and ICL232 chips. Do not touch the pins and only handle them bytheir ends. It is advisable to use sockets for these two chips.
Starting
The first thing to do is inspect the PCB for shorted or open tracks or otherdamage. Be aware of the static warning when doing this check. When you aresatisfied that all is well, then you can proceed.
Start with the flattest parts first, which are the resistors. Hold each resistor bodyby the thumb and forefinger and use your other hand to loosely bend both of theleads over at right angles at the same time. Try not to make the bends too sharp,and you will find that they slide straight into the mounting holes on the board.
Leave the pigtails on each of the components until after soldering as the extralead length serves as a heat sink for the component. Try not to leave thesoldering iron on the components too long or you risk damaging them. The usualmethod is to hold the iron tip so that it touches the component lead and the PCBpad at the same time, and then apply a small dab of solder. This operationshould only take about a second or two. If you are unsure of your solderingability, find some spare components and practice on these before building theprogrammer board.
Check that each solder joint is bright and shiny and doesn't look like a big dullblob which could mean a dry solder joint. The solder should flow freely onto thecomponent lead and solder pad if it is to be a good joint.
After the resistors are soldered in, recheck your work and then mount the diodesD1, D2 and D3
There are 4 LEDs that can be mounted next. Make sure theyare oriented correctly. The Anode is marked on the PCB andis the longer of the two leads on the component. TheCathode has a flat surface on the LED body and is alsomarked on the board.
Next, if supplied, mount the IC socket for the PIC16F628 chip.
Now you can mount the box poly (MKT) capacitors. Most of these look the same,so check the values and make sure they are inserted into the correct positions.Then solder the four 22p ceramic capacitors.
Next, mount all the electrolytic capacitors. These are polarity sensitivecomponents so make sure they are mounted properly. The positive lead is longerthan the negative lead, and the negative lead is also marked on the side of thecapacitor. On the PCB overlay, there are holes marked [+] as the positive leadfor each of these components.
There are five transistors supplied. Four of them are PNP type BC558, and oneis an NPN BC547. Do not mix them up and mount them as shown on the PCBoverlay.
Now solder the 9 pin RS232 socket, the USB socket and the power jack on tothe board followed by the 7805 and 78L08 regulators, again carefully checkingorientation.
The next parts to mount are the 2 crystals. One is a 4MHz type and the other is a6MHz so don't get them mixed up.
You can now mount the DPDT switch and the ZIF socket.
There is 1 wire link that needs to be fitted to the board. DO NOT insert it at thisstage.
The last things to fit to the board are the rubber feet. These stick to theunderside of the PCB, one in each corner.
Now you should go over all of your work and inspect for dry or unsoldered jointsand check all components for correct orientation and placement.
If you are satisfied that all is well, then you will need an 18VDC power supply totest the board. Positive should be on the inner connection of the power jack asshown on the PCB overlay.
Connect the power and observe thatthe power LED (L4) lights. If not,turn off the power immediately andcheck the orientation of diode D2 ndthe power wiring. Re-check the PCBfor any other mistakes.
Turn the power back off if the LEDdid light up. Make sure you have amultimeter ready for use and set it tomeasure 5 volts DC. Turn the PCBback on and measure the voltagebetween a test pads marked on thePCB (+5V) and (Gnd) near theRS232 socket.
The meter should read close to 5 volts. If not, turn off the power immediately andcheck that the regulators are inserted properly.
Go over the PCB again and check thoroughly for incorrectly placed components,shorts or open circuit joints.
If all is well, turn off the power again.
Next, mount the 7406 hex open collector inverter, U4, and the ICL232 chip, U3,taking care of chip orientation as it is very hard to remove these chips oncesoldered. Remember about chip handling and static.
Now comes the time to insert the wire link LK1 near thepower jack. This can be a discarded pigtail from aresistor or capacitor. This link completes the powerconnection to the USB chip and its circuitry.
Now insert the PIC16F628 into its socket. Pin 1 is towards the power jack.
Image of the finished PCB.
Connect a serial cable between the board and your PC. This cable is a straightthrough type, NOT a null modem cable. In other words, pin 1 at one endconnects to pin 1 at the other end, pin 2 to pin 2 etc.
Make sure the switch is operated towards the [SERIAL] side.
Run the programmer software for the kit. MicroPro.exe
Click [File] -> Port or double click the COM x label on screen to bring upthe COM port window. Select the COM port that you will use for serialcommunications, then [OK].
Re-check the power and PC connections and turn on the programmer board.
You should see Board connected appear on screen. If not, check your cable,the PC port setting and also that the switch is set properly.
If all is well, then as a simple system test, select 16F84 from the chip selectmenu and click on Read. You should see some LEDs light and the programmerwill read from a non existant chip. The screen will most likely fill with 0000's.
Now you can turn off the PCB and prepare it for the USB test.
First off, disconnect the serial cable and move all of the switch to the [USB] side.
To enable USB capability for your PC and this project you will need to install aspecial driver. This is a piece of software that handles the communicationsbetween the PC and the special USB chip on the programmer PCB.
Create a USB driver sub directory into the directory where your programmersoftware was installed. C:\diyk149 was the default. Therefore you would havea new directory called C:\diyk149\usb.
The drivers come in 2 flavours, plug and play support and no plug and playsupport. As this programmer does not have plug and play support, that narrows itdown to 1 choice.
You will need to visit this web page and download this driver.
VCP drivers for Win 98/2000/ME/XP (without PNP support)
http://www.ftdichip.com/FTDriver.htm
Download and unzip the file into the newly created USB directory.
Now visit this other web page and download the PDF application note thatdescribes how to install the driver for your particular system.
http://www.ftdichip.com/FTApp.htm
For example you would download...
AN232-03 for Win 98
AN232-05 for Win2000
Download the PDF file into the USB driver directory listed above.
Open and follow the simple directions given in the PDF file. This should only takea few minutes to do.
When the driver installation is completed, connect a USB cable from the PC tothe programmer board.
Make sure MicroPro.exe is not running on the PC.
Turn the board on. Nothing will appear to happen at this stage although you mayget a message from Windows saying that it has found new hardware..
Now run MicroPro.exe.
Click [File] -> Port or double click the COM x label on screen to bring upthe COM port window. Select the COM port that you selected for use for USBcommunications while installing the driver, then OK.
The PC may take a short while to establish communications with the USB port.When it has done so, the COM port number will appear on screen and theprogrammer is ready for use on the USB port.
If all is well, then again as a simple system test, select 16F84 from the chipselect menu and click on Read. You should see some LEDs light and theprogrammer will read from a non existant chip. The screen will most likely fill with0000's.
Your new programmer is now ready for use.
When using the USB interface, always turn theprogrammer on before starting MicroPro.exe.
When finished with the programmer, close MicroPro.exethen turn off the board.
Failure to use this power up sequence may result in a stalled PC because of thenon responding USB port.
IMPORTANT INFORMATION
Please do not insert any chip into the programming socket unless theboard is connected to the PC either via the serial port or the USB port andthe MicroPro software is running.
The controller PIC on the board is held in a reset state until MicroPro gainscontrol of it. In this reset condition, there will be stray voltages present inthe programming socket.
There is a modification that keeps these voltages turned off unless neededby the programmer. Please see “resmod.pdf” in your installation directory.It requires the addition of 3 resistors.
The PCB in this project has no protective covering. Please make sure thatthe underside does not come into contact with any conductive surface ortools or damage may result. The same may happen if something is droppedonto the top of the PCB.
It is possible to damage components if accidental short circuits are placedin the programming socket.
It is possible to damage components and PICmicro® chips if they areplaced in the programming socket incorrectly.
18VDC is sufficient to run this programmer. Try to avoid higher voltages orthe regulators may overheat.
Do not power this project with AC voltages. Only use DC.
In Circuit Serial Programming
This programmer is capable of doing In Circuit Serial Programming (ICSP).
ICSP allows you to program a PICmicro® that is already plugged into it’s targetcircuit. That is, the chip does not need to be in the programmer socket toprogram it.
The circuits on the following page give some ICSP connection examples.
ICSP programming needs to have control of two PIC pins which are used forClock and Data. These are usually PORTB pins RB6 and RB7. It also needs tocontrol the MCLR pin and the VCC pin(s). A common ground connection mustalso be made.
In some cases the ICSP programmer cannot reliably control the programmingpins on the PIC because of any connections to these pins that form part of yourcircuit. Voltage rise times can be critical for programming and if your circuit drawstoo much current, or has a high capacitive load then ICSP may not work.
If your target circuit draws more than around 60mA, or your circuit is not suitablefor an external 5 volt supply. then your circuit will need to supply the 5 volt power.In this case leave the VccP wire disconnected. Some PIC chips need to have the5 volt rail specifically controlled, and will not be able to be programmed with theVccP wire disconnected. The 16F675 is one example.
Not all circuits will accept ICSP programming, so if you cannot get the chip toprogram properly using this mode, then the only options are to totally isolate thePIC on the target board, or just use the programming socket.
Be aware that incorrect connections between your circuit and the ICSPconnector may cause damage to both your circuit and the programmer.
Please note that LVP programming is not supported.
ICSP PROGRAMMING EXAMPLES
PARTS LIST
Used Part Type Designators Description
SEMICONDUCTORS
1 74LS06 U4 OC Hex Inverter1 ICL232 U3 RS232 transiever1 PIC16F628 U5 PIC Processor1 FT232BM U6 USB1 78L08 U1 Regulator1 7805 U2 Regulator1 6MHz X1 Crystal1 6MHz X2 Crystal4 BC558 TR1 TR2 TR3 TR5 PNP Transistor1 BC547 TR4 NPN Transistor1 IN4004 D2 Diode2 IN4148 D1 D3 Diode1 PWR L1 3mm LED1 VPP1 L4 3mm LED1 VPP2 L3 3mm LED1 VCCP L2 3mm LED
RESISTORS all 1/4W 5%
2 10R R20, R231 470R R255 1K R1, R4, R12, R131 1K5 R223 2K2 R5, R10, R151 3K3 R83 4K7 R11, R14 R168 10K R2, R3, R6, R7, R9 R21 R28, R291 22K R174 100K R18, R19, R24, R261 470K R27
CAPACITORS
4 22p C9, C10, C11, C12 Ceramic1 10N C13 MKT1 33N C15 MKT4 100N C7, C8, C14, C16 MKT4 1uF C1 C3 C4 C5 Electrolytic 16V1 10uF C2 Electrolytic 16V1 47uF C6 Electrolytic 16V
MISCELLANEOUS
1 BLANK PCB PCB11 IC SOCKET 18 pin1 SERIAL CN1 Female RA DB91 USB CN2 UT-56764 FEET Rubber Feet1 JACK JK1 3 Pin Power Jack1 SWITCH SW1 DPDT1 HEATSINK1 SCREW & NUT
1 2 3 4 5 6
A
B
C
D
654321
D
C
B
A
C7100N
X16MHz
C922p
C1022p
Vcc
Vin1
GN
D2
Vout3
U27805
Vin1
GN
D2
Vout3
U178L08
Vcc
C210uF
123456789
1011121314151617181920 21
22232425262728293031323334353637383940
SKT1PROGRAMMER
C647uF
SVP1SVP2
C8100N
Gnd
Gnd
VON
R52K2
L2VCCP
CS
L1
PWR
R83K3
R710K
PV
R310K
123
JK118VDC
L3VPP2
L4VPP1
R152K2
R102K2
SVP1
SVP2
VO
N
162738495
CN1
SERIAL
C31uF
C41uF
C11uF
C5
1uF
C1+1
C1-3
C2+4
C2-5
+102
-106
T1in11
T2in10
R1out12
R2out9
T1out14
T2out7
R1in13
R2in8
GN
D15
VC
C16
U3ICL232
Gnd
R144K7
R114K7
DATA
DATA
DATA
DATA
CLOCK
CLOCK
CLOCK
CLOCK
PV
CS
VPP1
VPP2
VPP2
Gnd
Gnd
Gnd
GndGnd
GndGnd
VccP
VccP
VccP
VccP
R1
1K
R121K
R131K
TR3BC558
TR1BC558
R910K
R210K
VPP1
VPP2
12
U4A
34
U4B
TR2BC558
R610K
R41K
56
U4C
VO
N
SVP1
SVP2
Vcc VccP
GndGnd
VccP Gnd
Gnd
AV
CC
30
VC
C3
VC
C13
VC
C26
USBDP7
USBDM8
3V3OUT6
XTIN27
XTOUT28
RCCLK31
RESET#4
EECS32
EESK1
EEDATA2
TEST5
AG
ND
29
GN
D9
GN
D17
SLEEP#10
RXLED#11
TXLED#12
PWRCTL14
USBEN15
TXDEN16
RI#18
DCD#19
DSR#20
DTR#21
CTS#22
RTS#23
RXD24
TXD25
U6FT232BM
1234
CN2USB
R2010R
R2310R
R25470R
R221K5
R24100K
R27470K
R19100K
R26100K
TR5
BC558X2
6MHz
C1222p
C1122p
C1533N
C14100N
C16100N
C1310N
XA
XA
XB
XB
Vcc
URST
URST
UV
UV
Gnd
Gnd Gnd
TXRX
UTXURX
UTX
URX
RA017
RA118
RA21
RA32
RA43
RB06
RB17
RB28
RB39
RB410
RB511
RB612
RB713
MCLR4
OSC116
OSC215
Gnd
5V
CC
14
U516F628
RX
TX
CLOCKDATA
9 8
U4D 11 10
U4E
13 12
U4F
D2IN4004
TR4BC547
R1722K
R18100K
UVR2810K
MCLR
USBRST
74LS06
THIS LINK IS SOLDEREDIN POSITION AFTER THE
POWER CHECKS HAVE BEEN MADE
UV
1 2
LK1USBPWR
R2110K
Vcc
MCLR
USBRST
RS2RST
RS2RST
S1SERIAL USB
TXA
TXARXA
RXA
D3
1N4148
D1
1N4148
R164K7
Vcc
R2910K
VccP