pickit 2 connection with pic 16f84a.doc

7
PICkit 2 Home MPLAB Order Contact Us PROGRAMMING A PIC16F84A USING THE PICkit 2 AND A SIMPLE PROGRAMMING ADAPTER The PICkit 2 (tm) comes with its own programming software which we will use here. Some devices may be programmed using MPLAB and accessing the PICkit 2 as one of the programmer options under MPLAB. The PICkit 2 has a 6-pin header socket as the interface to a user board. Our goal is to make a connection to a socket for the 18-pin PIC16F84A.

Upload: bing

Post on 26-Oct-2015

139 views

Category:

Documents


4 download

DESCRIPTION

PIC16F84A coonection to PICKIT2

TRANSCRIPT

Page 1: PICkit 2 connection with pic 16f84a.doc

PICkit 2

Home

MPLAB

Order  

Contact Us

PROGRAMMING A PIC16F84A USING THE PICkit 2 AND A SIMPLE PROGRAMMING ADAPTER

The PICkit 2 (tm) comes with its own programming software which we will use here. Some devices may be programmed using MPLAB and accessing the PICkit 2 as one of the programmer options under MPLAB. The PICkit 2 has a 6-pin header socket as the interface to a user board.

Our goal is to make a connection to a socket for the 18-pin PIC16F84A.

Page 2: PICkit 2 connection with pic 16f84a.doc

This can be accomplished in several ways. We will explore two.

The first method is to use a 6-pin right angle header, a very small piece of prototyping printed circuit board, five wires, and a small solderless greadboard.

The chunk of board provides a way to connect the wires to the header easily. It is a portion of a prototyping board with rows of pads.

The header has 0.100 inch pin spacing and the pins are 0.025 inch square. Measuring the Microchip headers and boards that I have purchased showed that the pins extend from 0.130 to 0.200 inches beyond the edge of their boards or bare headers. I filed off the edge of my board to give 0.200 engagement with the PICkit 2 header.

As an aside, I thought of mounting a socket for the microcontroller and the header on a small board that would plug directly into the PICkit 2. I decided not to do it because pushing the device into the socket for programming and prying it out of the socket after programming would put strain on the PICkit 2 header. Doing this repeatedly would not be a good idea, in my opinion.

Notice that the wires connecting the header board to the solderless breadboard arch up and over. The idea is to minimize the strain imposed on the PICkit 2 header as devices are inserted and removed.

The second method is more permanent. For experimenting and development,

Page 3: PICkit 2 connection with pic 16f84a.doc

Microchip offers an adapter consisting of a very small board with a header to mate with the socket on the PICkit 2 plus a modular phone jack. A short 6-conductor phone cable is included to connect the adapter to a modular phone jack on your board. The Microchip part number is AC164110 (ICD 2 to ICSP adapter).

You can easily build a board with a modular phone jack to connect with the short cable mentioned above and a zero insertion force (ZIF) socket to hold the PIC16F84A during programming.

I would definitely use a ZIF socket for the PIC microcontroller to avoid bending or damaging the pins. 18-pin ZIF sockets are becoming expensive and difficult to find. The once common part made by the TEXTOOL division of 3M is still available from Digi-Key. It is the gold plated (literally) version (3M part number 218-3341-00-0602J) and the cost is around $18.

A 24-pin Aries socket is available from JAMECO, Digi-Key and others. The Aries part number is 24-6554-10 (tin plated contacts) and the price will be in the $8 range. Simply ignore the extra 6 pins.

A modular phone jack is used to connect to the ICD via cable. A printed circuit board style jack is shown. One manufacturer is tyco Electronics AMP. The part number is 5204703. The Digi-Key part number is A9049-ND.

Page 4: PICkit 2 connection with pic 16f84a.doc

The modular phone jack is connected as shown:

The PICkit 2 will power the board with the microcontroller on it. Power will be applied only while actual programming is occurring. This means that the device may be inserted in the ZIF socket or removed while the PICkit 2 is powered-up by the computer USB port.

Connect the PICkit 2 , adapter, modular phone cable, and your ZIF socket board together. Connect the PICkit 2 to your PC using the USB cable supplied with it.Power-up the PC.The PIC16F84A may be inserted in the ZIF socket at any time prior to initiating the device          programming cycle.Open the PICkit 2 programming software.The PICkit 2 software will come up recognizing the PIC16F84A (assuming the midrange         device family was selected the last time the software was used). If not, on the Menu Bar,

Page 5: PICkit 2 connection with pic 16f84a.doc

         select Device Family>MidrangeCheck /MCLR in the small Vdd PICkit 2 box.Load your .hex file into MPLAB's Program Memory (zone).

File>Import Hex Navigate to your .hex file. Select the file. Click Open. A message will appear indicating that the file has been imported.Click on the Write button to program the device. A message should appear reporting success.

Inert the programmed device into the socket on your target board. Power-up the target board. Observe your code working (or not).

To program and run another program, load another .hex file and repeat the programming procedure.

If you have questions, contact us by eMail at [email protected], telephone (208) 664-4115, fax (208) 772-8236. Dave & Wanda

  [Home]   [MPLAB]   [Order]  

    [Contact US   ]

   [TOP OF PAGE]

(c) Copyright 1996-2008 Square 1 Electronics, last updated November 5, 2008