Search this Blog

Thursday, March 5, 2009

3-in-1 mini-Lab Application Note for PIC16F628A

Author: Chaonan Chen, Huihui Duan, Au Group Electronics
Au Group Electronics developed 2-in-1 mini-Lab or 3-in-1 mini-Lab is an integrated system capable of programming and on-board testing PIC microcontroller in both SOIC (up to 28 pin) and DIP (DIP 8, 14, 18, 20, 28, 40) packaging. It is able to connect microcontrollers to multiple programmers (e.g. Au Group Electronics BB0703, BB0703+, microchip PICkit2, ICD2, ICD3, RealICE, etc.) through either a "6-pin ICSP header" or a "RJ12 6P6C socket". It also provides lab-test circuits including on-board voltage regulator (+5V, +3.3V, +2.5V), pull-up circuit, pull-down circuit, cap connection, bidirectional voltage-level translator, and LEDs.

This application notes will demonstrate:

1. ICSP wire connection
2. Step by step Hex programming for PIC16F628A in DIP/SOIC packaging
3. On-board LED test with 6-digit binary LED counter program.
What you need:

All hardware that were used in this application note are listed in table 1.

Major devices are displayed in figure 1
Jumper Wire Connection for Programming:

To burn program into microcontroller, the 6 ICSP connections need to be build between the RJ12 6P6C connector (J1) and the target chipset. On 3-in-1 mini-lab, J1-1, J1-2, J1-3 are the extension pin headers for RJ12 6P6C connector, JZ-x (JZ-1 to JZ-6) are the extension pin headers for SOIC and DIP ZIF socket. The 5 ICSP signal on a few microcontrollers are illustrated in figure 2. Use female jumper wires to connect J1-1 to JZ-x per table 3. The connection is demonstrated in figure 3. There are two methods to load hex file into target chipset: programming with a PC or Programmer-to-Go.

Programming with a PC

1. Place one piece of PIC16F628A chipset into the DIP/SOIC ZIF socket of the 3-in-1 mini-Lab (Note: only place one PIC chip at a time. E.g. put a SOIC packaged chipset in SOIC-ZIF socket; or put a DIP packaged chipset in DIP-ZIF socket. Please make sure Pin 1 of PIC16F628A agrees with the 1st-pin-mark on the circuit board)

2. Connect 3-in-1 mini-Lab, BB0703, and a PC by using a "RJ12 6Pin reverse cable" and a "type-B USB cable", as shown in figure 4.

3. Double click PICkit 2 shortcut icon on desktop to open up PICkit 2 Programmer window.
4. "PICkit 2 Programmer" window open up. If device name "PIC16F628A" and "Midrange / Standard Device found" displayed, as shown in figure 5, go to step 5.

If the device in the ZIF socket are not auto-detect (figure 6), click ProgrammerèManual Device Select (figure 7), make sure the checkmark before "Manual Device Select" is gone, continue with step 5 5. Click File/Import Hex (Figure 8), Select "628A_LED_Binary_Counter" hex file then click "Open", Message "Hex file successfully imported" displayed (Figure 9).

Note: a hex program "628A_LED_Binary_Counter" is used here for a demonstration purpose, it is provided for free in the Au Group Electronics PIC learning kits.

6. Click "Write", wait a few seconds, message box will display "Programming Successful", as shown in figure 10

Programmer-to-Go (Programming without a PC)

1. Refer to BB0703 (PICkit 2) PTG application note for how to import and download hex file into BB0703 (PICkit 2). After that, PC is not needed for programming microcontroller.

2. Connect the BB0703 with 3-in-1 mini-Lab using a RJ12 reverse cable.

3. Power up BB0703 with +9 V DC supply, as shown in figure 11. The "Target" LED will blink indicating it's ready to program the chip.

4. Load the ZIF with PIC16F628A chipset

5. Press "Program" button on BB0703 (PICkit 2), "Busy" LED will be constant on

6. Wait a few seconds/minutes, until "Busy" LED is off and "Target" LED blink again, which means the hex file has been burned into the 16F628A device successfully.

7. Repeat steps 4-6 for programming another PIC16F628A chipset.
After using any of the above two methods load hex file to target chipset. We can use the 6 LEDs on 3-in-1 mini-Lab to perform a circuit test.

These 6 LEDs are located between the board edge and DIP-ZIF socket. The extension headers for LEDs is J4 (D4, D5, D6, D7, D8, D9), which is located between the DIP-ZIF and SOIC-ZIF.

1. Connect the PIC16F628A (JZ-x) with LEDs (J4) using female jump wires per table 2.

2. Connect J6-5V to pin "VDD-2" on J2-1 with female jump wire,

3. Plug a 9V DC power supply to J5, as shown in figure 12. All 6 LEDs will start lit for 1 second (bin: 111111), then the 6 LEDs’ status will be changed every 1 second, accumulate from 1 to 111111, then reset to 000000, and repeat from 1 to 111111 thereafter until power off.

The LED status is illustrated in table 5. The relative binary, hex, and decimal is also referenced in the same row.

Any question or suggestion about this application note, please contact us at:

1 comment:

  1. Per request, Comments feature are turned on Jan-09-2010.


Any comments, suggestion, idea? Please posted here.