It suggested there is not a good connection in your ICSP wiring. It may well be that the header pins are not long enough, mine never were but they would catch just enough to let you think the were. Then check the wiring again.PKWarn0003: Unexpected device ID: Please verify that a PIC18F4685 is correctly installed in the application. (Expected ID = 0x2760, ID Read = 0x0)
Found PICkit 2 - Operating System Version 2.32.0
PICkit 2 Unit ID = Junebug
Target power detected ( 4.99V)
PKWarn0003: Unexpected device ID: Please verify that a PIC18F4685 is correctly installed in the application. (Expected ID = 0x2760, ID Read = 0x0)
PICkit 2 Ready
Found PICkit 2 - Operating System Version 2.32.0
PICkit 2 Unit ID = Junebug
Target power detected ( 4.99V)
PIC18F4685 found (Rev 0x1)
PICkit 2 Ready
Programming Target (1/30/2010 3:25:42 AM)
PIC18F4685 found (Rev 0x1)
Erasing Target
Programming Program Memory (0x0 - 0xFF)
Verifying Program Memory (0x0 - 0xFF)
Programming Configuration Memory
Verifying Configuration Memory
PICkit 2 Ready
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
void main()
{
ADCON1 = 0x0F; // make RA0 digital
TRISA = 0b00000000;
//PORTA = 0b00000100; // Turn LED on
LATA = 0b00000100;
while(1); // loop forever
}
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
void main()
{
ADCON1 = 0x0F; // make RA0 digital
CMCON=0x07;
CVRCON=0;
TRISA = 0b00000000;
//PORTA = 0b00000100; // Turn LED on
LATA = 0b00000100;
while(1); // loop forever
}
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
void main()
{
ADCON1 = 0x0F; // make RA0 digital
TRISA = 0b11111011;
//PORTA = 0b00000100; // Turn LED on
LATA = 0b00000100;
while(1); // loop forever
}
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
void main()
{
int x=1;
ADCON1 = 0x0F; // make RA0 digital
for(;;)
{
for(x;x<=100;x++)
{
TRISA = 0b11111011;
LATA = 0b00000100;
}
for(x;x>=1;x--)
{
TRISA = 0b11111011;
LATA = 0b00000000;
}
}
while(1); // loop forever
}
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
void main()
{
int x=1;
ADCON1 = 0x0F; // make RA0 digital
for(;;)
{
for(x;x<=500;x++)
{
TRISA = 0b11111011;
LATA = 0b00000100;
}
for(x;x>=1;x--)
{
TRISA = 0b11111011;
LATA = 0b00000000;
}
}
while(1); // loop forever
}
Alright, I figured out the problem. I had to set the all of the pins I wasn't using as inputs and ground them. However, when I connect to the Junebug the LED turns off. Only when I first plug in the Junebug, the LED lights up. When I connect or program I just see the LED flash.
(only turns on when first connected, else it just blinks when connecting or programming)
Code:#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON #include <p18f4685.h> #include <delays.h> void main() { ADCON1 = 0x0F; // make RA0 digital TRISA = 0b11111011; //PORTA = 0b00000100; // Turn LED on LATA = 0b00000100; while(1); // loop forever }
Does anyone know what I might be doing wrong? I would greatly appreciate the help. Thank you.
void main()
{
OSCCON = 0x72; //8MHz clock
while(!OSCCONbits.IOFS); //wait for osc stable
ADCON1 = 0x0F; // make RA0 digital
TRISA = 0b00000000; //You can leave all outputs.. (Recommended)
while(1){ // loop forever
LATA = 0b00000100; //ON
Delay10KTCYx(100); //DELAY 500mS
LATA = 0b00000000; //OFF
Delay10KTCYx(100); //DELAY 500mS
}
}
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
#define Delay500mS() Delay10KTCYx(100)
#define LED LATAbits.LATA2
#define ON 1
#define OFF 0
void main()
{
OSCCON = 0x72; //8MHz clock
while(!OSCCONbits.IOFS); //wait for osc stable
ADCON1 = 0x0F; // make RA0 digital
TRISA = 0b00000000; //You can leave all outputs.. (Recommended)
while(1){ // loop forever
LED = ON; //ON
Delay500mS(); //DELAY 500mS
LED = OFF; //OFF
Delay500mS(); //DELAY 500mS
}
}
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
void main()
{
int x=1;
ADCON1 = 0x0F; // make RA0 digital
for(;;)
{
for(x;x<=500;x++)
{
TRISA = 0b11111011;
LATA = 0b00000100;
}
for(x;x>=1;x--)
{
TRISA = 0b11111011;
LATA = 0b00000000;
}
}
while(1); // loop forever
}
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
void main()
{
unsigned int x;
OSCCON = 0x72; //8MHz clock
while(!OSCCONbits.IOFS); //wait for osc stable
ADCON1 = 0x0F; // make RA0 digital
TRISA = 0b00000000; // make all output
for(;;) // main loop
{
for(x=0;x<1000000;x++)
{
LATA = 0b00000100; // turn on 1,000,000 times (aka 500mS)
}
for(x=0;x<1000000;x++)
{
LATA = 0b00000000; // turn off 1,000,000 times (aka 500mS)
}
}
}
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
void main()
{
int x=1;
ADCON1 = 0x0F; // make RA0 digital
for(;;)
{
for(x;x<=500;x++)
{
TRISA = 0b11111011;
LATA = 0b00000100;
}
for(x;x>=1;x--)
{
TRISA = 0b11111011;
LATA = 0b00000000;
}
}
while(1); // loop forever
}
OSCCON = 0x72; //8MHz clock
while(!OSCCONbits.IOFS); //wait for osc stable
#pragma config OSC=IRCIO67, WDT=OFF, LVP=OFF, DEBUG=ON
#include <p18f4685.h>
#include <delays.h>
void main()
{
unsigned int x=0;
OSCCON = 0x72; //8MHz clock
while(!OSCCONbits.IOFS); //wait for osc stable
ADCON1 = 0x0F; // make RA0 digital
TRISA = 0b11111011; // make all input but RA2 (pin 4)
for(;;) // main loop
{
for(x;x<=15000;x++)
{
LATA = 0b00000100;
}
for(x;x>=1;x--)
{
LATA = 0b00000000;
}
}
}
OSCCON = 0x72; //8MHz clock
while(!OSCCONbits.IOFS); //wait for osc stable
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?