Hey guys, this is my first time posting here. It was recommended by the all about circuits forum that I post my questions here. I apologize if this has been asked before, but I could use the help specifically related to my problem. 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:
Now, here is the problem. When I connect the ribbon cable shown here (the second picture towards the bottom):
16F or 18F and advice on selecting a programmer to use - Page 2 - All About Circuits Forum
I get the following error:
(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 in advance.
EDIT
____
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.
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:
#pragma config OSC=INTIO2, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f1320.h>
#include <delays.h>
void main()
{
ADCON1 = 0x7F; // make RA0 digital
TRISA = 0b10111110;
PORTA = 0b00000001; // Turn LED on
while(1); // loop forever
}
16F or 18F and advice on selecting a programmer to use - Page 2 - All About Circuits Forum
I get the following error:
Code:
Programming Target (12/18/2009 12:55:25 AM)
PKWarn0003: Unexpected device ID: Please verify that a PIC18F1320 is correctly installed in the application. (Expected ID = 0x7C0, ID Read = 0x0)
Erasing Target
Programming Program Memory (0x0 - 0xF7)
Verifying Program Memory (0x0 - 0xF7)
PK2Error0027: Failed verify (Address = 0x0 - Expected Value 0xEF63 - Value Read 0xFFFF)
PICkit 2 Ready
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 in advance.
EDIT
____
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 by a moderator: