Search this Blog

Thursday, March 19, 2009

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

Au Group Electronics
Author: Chaonan Chen, Huihui Duan, Au Group Electronics

This application note uses a dsPIC33FJ64GP802 (28-pin SOIC SMD package) demonstrating step by step operation on how to use Au Group Electronics "3-in-1 mini-Lab" and "BB0703 programmer" to burn program/code into a dsPIC33F microcontroller.

(Note: Experiences found that the VDD level on BB0703 (PICkit 2) is very critical for programming dsPIC33F family microcontrollers, without set it correctly might result in program/erase/blank-check failure. Due to design/engineering tolerance, it is noticeable that the actual VDD voltage on each individual BB0703 (PICkit 2) devices can vary up to 0.1V while programming.)

What you need:

Major devices that were used in this application note are displayed in figure 1, Au Group Electronics part # of the devices that applied in this application note are listed in table 1.

There are two methods to load hex file into target chipset: programming with a PC or Programmer-to-Go. This application note will show both methods.

Program dsPIC33FJ64GP with a PC:

If hex file has not been loaded into BB0703 (PICkit 2) programmer, a PC is needed.
Step 1. Connect 3-in-1 mini-lab, BB0703 together with a PC by a "RJ12 6Pin reverse cable" and a "type B USB cable".
Step 2. Place a piece of dsPIC33FJ64GP802 into the 3-in-1 mini-Lab SOIC ZIF socket
Note: Only place one chip at a time. E.g. either put a SOIC packaged chipset in the SOIC-ZIF socket; or put a DIP packaged chipset in the DIP-ZIF socket. Make sure Pin 1 of dsPIC33FJ64GP agrees with the 1st-pin-mark on circuit board.
Step 3. Use female jumper wires to connect "J1-x" to "JZ-x" on the 3-in-1 mini Lab. The position of both ends of the female jump wires are color coded in figure 2.

Note: J1 (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.
ICSP signal on J1 and dsPIC33FJ64GP802 are illustrated in figure 3 for reference

The hardware setup of Programming with a PC is shown in figure 4.

Step 4. Double click shortcut of “PICKit 2 V2.6” (Figure 5)

Step 5. A PICkit 2 Error message may or maynot show up (figure 6). Click “Ok” button. "PICkit 2 Programmer" window open up, PICkit 2 connected and ID displayed but No Device Found, as shown in figure 7.

Step 6. On 3-in-1 mini Lab, use a piece of female jump wire to connect "J3-pin 6 Cap" with "JZ-4-Pin 20", and another jump wire to connect "J3-pin 1 (Pull up)" with "JZ-2-pin 1". The overall jump wire connection on 3-in-1 mini-Lab is shown in figure 8.

All the jump wire connection on 3-in-1 mini-Lab and the signal on both ends are summarized in table 2

Step 7. On PICkit 2 programmer software interface, Click Tools/Check Communication (figure 9).

Step 8. Notice that PIC Device found, and dsPIC33FJ64GP802 displayed. Lower VDD from 3.3 to lower range (between 2.7V to 2.9V)*, and check VDD On, then click “Erase” button (figure 10-1).

* Note:
Base on the multiple devices test (see attached test results for more information, it is provided for reference purpose only), Au Group Electronics noticed that as long as the actual VDD-GND voltage (at device end) falls into the range from 2.74V to 2.91 V, the dsPIC33FJ64GP can be programmed very reliably. If VDD voltage is less then 2.71V or higher than 2.94V, it might not working as reliable as the [2.74V, 2.91V] zone. When the voltage is out of [2.74V, 2.91V] zone, it may indicate “Program memory is not blank” (Figure 10-2) while "blank check" button is clicked, or indicate “Programming of Program Memory failed” (Figure 10-3) while "write" button is clocked. So always try 2.7V, 2.8V, and 2.9V on individual BB0703 (PICkit 2) until programming successfully (this will make sure the VDD at chip end in the user-friendly [2.74V, 2.91V] zone).

If the device in the ZIF socket are not auto-detect, Click "Programmer->Manual Device Select", make sure the checkmark before "Manual Device Select" is gone (picture not show).

Step 9. Wait a few seconds until “Erasing device … Complete”, then click “Blank Check” button, as shown in figure 11.

Wait a few seconds, “Device is Blank” will display, as shown in figure 12

Step 10. Load your target Hex file, then click “Write” button, as shown in figure 13.

Wait a few seconds, message box will display "Programming Successful", as shown in figure 14

For programming multiple chipsets, the Programmer-to-Go feature on BB0703 (PICkit 2) will be another convenient and productive solution. It will be demonstrated at the following steps.

Programmer-to-Go (Programming without a PC)

Step 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.
Step 2. Connect the BB0703 with 3-in-1 mini-Lab using a RJ12 reverse cable.
Step 3. Power up BB0703 with +9 V DC supply, as shown in figure 15. The "Target" LED will blink indicating it's ready to program target chip.

Step 4. Load dePIC33FJ64GP802 into ZIF socket.
Step 5. Press "Program" button on BB0703 (PICkit 2), "Busy" LED will be constant on,
Step 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 target chipset successfully.
Step 7. Repeat steps 4-6 for programming another dePIC33FJ64GP802 chipset

Test Result to Find the user friendly VDD zone for dsPIC33F64GP802

(Note: Test Data for technical reference only, it cannot be used for any other purpose.)

Actual VDD voltage (from individual BB0703(PICKit 2) device) measured at dsPIC33F64GP802 Chip end is listed in the following table:
(VDD: voltage measured at chip end)
(Program Voltage: VDD set by PICKit 2 application sofware)


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

  2. Thanks so much for this!I was beyond frustrated until I came across this!

    Pity the datasheet doesnt mention this fact...

    I am using the dsPIC33FJ128GP802 and I can only program it with 2.8 V and 4.7 uF VCAP capacitor (using the PICkit2 and no external power supply)

    Thanks again!


  3. Thanks for letting us know you too observe the same test result we have found in our lab. Hope there will be a quiet silicon fix in future releases.

  4. Hi, i have a problem. i have a pickit2 clone, but i can't change vdd via software. i have a dspic33fj128gp804. then i change vdd with a trimmer until to 2.8 V. i did as you say. Before i click on Erase; the pickit2 says Erase complete. Then i click on Blank check and the program always says the program memory is not blank. What's happened? Is it possible the dspic is broken?

  5. It is hard to say, the trimmer may limit the current supply capability. Recommend try a 3.3V LDO or something similar to the PK2 Vdd regulator.

  6. Hi, I solved the problem about the voltage for dspic33fj128gp804. Now the device is blank!! Then i import a simple program and the pickit programs! Now i reimport the code or another for try the programmation. Then the software says programming executive error during write!But i programmed 5 seconds ago! But there is strange something. When i import the file,in the program memory, the locations aren't filled in succession! I use CCS compiler. It is a problem of compiler?? Because this problem is present in each code. The program memory is broken? Also the Verify is failed! I'm goig crazy! Thanks for the answer!

  7. Try one of the following:
    1. Use "Vpp first program entry"
    2. Disable "fast programming"

  8. No, i can't use "Vpp first program entry"...i don't know. I tried to use slow programming but nothing. There is thing that makes me laugh. The software "programs" the dspic if i click before on read!! But so, i didn't program nothing!! A this point i will buy the original pickit2! Thanks

  9. >I use CCS compiler. It is a problem of compiler?? Because this problem is present in each code. The program memory is broken? Also the Verify is failed! I'm going crazy!

    Please make sure you have all the configuration bit information included. You can verify this by importing the hex into MPLAB and Check the configuration bit info.

  10. >A this point i will buy the original pickit2! Thanks

    Good. Either Microchip PK2 or Au Group Electronics' enhanced PK2 design (BB0703/BB0703+) should be able to control the programming signal under the chip spec.

    Let us know what you have found.


Any comments, suggestion, idea? Please posted here.