deepa.malagi
New Member
Hi,
I am unabal to program the ic properly .In debug mode after programming when i press run it showing error message as
PK3Err0040: The target device is not ready for debugging.
Please check your configuration bit settings and program
the device before proceeding.
my configuration bits are
oscillator = internal rc on clk
master clear enable = external
rest all are off
and I am using HI-tech c compiler
and my code is
#include<pic.h>
#define OUTPUT_SIGNAL 0x00
#define INUPT_SIGNAL 0x02
#define GPIO_OUTPUT_SIGNAL (GPIO&0x01)
#define GPIO_INPUT_SIGNAL (GPIO&0x02)
#define LED GPIO4
unsigned char INTR_FLAG = 0;
void configuretion (void);
void interrupt slow_led (void);
main()
{
//configuretion();
//OPTION = 0b01000111;
TRISIO=0x00;
while(1)
{
GPIO=0x22;
}
}
void configuretion (void)
{
OPTION = 0b01000000;
ANSEL = 0; //adc off - digital in/out
CMCON = 7; //turns comparators off
GPIO = 0; //all outputs set to 0
TRISIO = 0b00000100; //all outputs except pin GPIO2
INTCON = 0b1001000; //external interrupt enabled on GP2
}
void interrupt slow_led (void)
{
if(INTF) //check external interrupt flag bit
{
INTF = 0;
LED = 1;
INTR_FLAG = 1;
while(INTR_FLAG)
if((GPIO & 0x04) != 1)
INTR_FLAG = 0;
}
}
please anybody help me.
I am unabal to program the ic properly .In debug mode after programming when i press run it showing error message as
PK3Err0040: The target device is not ready for debugging.
Please check your configuration bit settings and program
the device before proceeding.
my configuration bits are
oscillator = internal rc on clk
master clear enable = external
rest all are off
and I am using HI-tech c compiler
and my code is
#include<pic.h>
#define OUTPUT_SIGNAL 0x00
#define INUPT_SIGNAL 0x02
#define GPIO_OUTPUT_SIGNAL (GPIO&0x01)
#define GPIO_INPUT_SIGNAL (GPIO&0x02)
#define LED GPIO4
unsigned char INTR_FLAG = 0;
void configuretion (void);
void interrupt slow_led (void);
main()
{
//configuretion();
//OPTION = 0b01000111;
TRISIO=0x00;
while(1)
{
GPIO=0x22;
}
}
void configuretion (void)
{
OPTION = 0b01000000;
ANSEL = 0; //adc off - digital in/out
CMCON = 7; //turns comparators off
GPIO = 0; //all outputs set to 0
TRISIO = 0b00000100; //all outputs except pin GPIO2
INTCON = 0b1001000; //external interrupt enabled on GP2
}
void interrupt slow_led (void)
{
if(INTF) //check external interrupt flag bit
{
INTF = 0;
LED = 1;
INTR_FLAG = 1;
while(INTR_FLAG)
if((GPIO & 0x04) != 1)
INTR_FLAG = 0;
}
}
please anybody help me.