Using a Junebug to program another microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by Micro9000, Dec 18, 2009.

  1. Micro9000

    Thread Starter New Member

    Sep 22, 2009
    Hey guys, it has been a few weeks, but I have some time off now that classes are over. I've started to try and program my microcontroller using the Junebug which I have purchased. I have the PIC18F4685, and I was wondering how I go about programming it through the Junebug.

    I have built and compiled a successful program for the Junebug where the LEDs flash. In doing so, I have made sure that the link and library paths are correctly linked in build options. Also, I have the necessary header file for the PIC18F1320, which the Junebug uses.

    I have found this C program on a tutorial site to do a simple test. Here is the code I have used:

    Code ( (Unknown Language)):
    1. #pragma config OSC=INTIO2, WDT=OFF, LVP=OFF, DEBUG=ON
    2. #include <p18f1320.h>
    3. #include <delays.h>
    5. void main()
    6. {
    7. ADCON1 = 0x7F; // make RA0 digital
    8. TRISA = 0b10111110;
    9. PORTA = 0b00000001; // Turn LED on
    10. while(1); // loop forever
    11. }
    Now, here is the problem. When I connect the ribbon cable shown here (the second picture towards the bottom):

    I get the following error:

    Code ( (Unknown Language)):
    1. Programming Target (12/18/2009  12:55:25 AM)
    2. PKWarn0003: Unexpected device ID:  Please verify that a PIC18F1320 is correctly installed in the application.  (Expected ID = 0x7C0, ID Read = 0x0)
    3. Erasing Target
    4. Programming Program Memory (0x0 - 0xF7)
    5. Verifying Program Memory (0x0 - 0xF7)
    6. PK2Error0027:  Failed verify (Address = 0x0 - Expected Value 0xEF63 - Value Read 0xFFFF)
    7. PICkit 2 Ready
    (Note: This only occurs when I connect the ribbon cable to the Junebug)

    I realize I am most likely missing a lot of steps and I probably should call to the PIC18F4685
    header file, but I am unsure of what else I could be doing wrong or how to even go about making the Junebug program the other PIC.

    In sum
    What do I need to add to the code (I'm sure it's off by a lot) or modify physically to properly program the PIC18F4685 using the Junebug?

    As always your help is much appreciated. Thanks.

    I do not currently plan to flash LEDs with the other PIC, but if possible, simply read any voltages/square waveforms coming out of one of the pins using my oscilloscope.
    Last edited: Dec 18, 2009
  2. THE_RB

    AAC Fanatic!

    Feb 11, 2008