Hello All,
I am trying to get the debugger working on a simple test program but not having much luck.
When I program it directly it works fine.
Is there some config bit I'm missing or some other setting screwed?
I have also noticed that MPLAB X says that "The requested operation cannot continue with the following configuration bit setting(s):
Flash Program Memory Code Protection bit = All program memory code-protected.
Would you like MPLAB to change the config setting(s) and continue? "
While in my code the CP bit is OFF. If I continue I get the error Failed to program device.
Compiler: Microchip MPLAB XC8 C Compiler V1.12
Chip: PIC16F877A
Programmer: PICKit 3
IDE: MPLAB X V1.70
OS: Windows 7
Code:
#include <xc.h> // Main PIC header file
#include <stdio.h> // Standwerererdard IO
#include <stdlib.h> // Standard utility functions
#include <stdint.h> // Contains standard int definitions
#include <stdbool.h> // Contains standard Boolean definitions
#include "bk300.h" // BK300 specific functions and definitions
#pragma config FOSC = HS // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled)
#pragma config BOREN = OFF // Brown-out Reset Enable bit (BOR disabled)
#pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3 is digital I/O, HV on MCLR must be used for programming)
#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)
void main (void){
initBoard();
initUART();
printf("Blinking LED 1! \n\r");
while (1){
setLed(1, 1);
delayMs(100);
setLed(1, 0);
delayMs(100);
}
}
The bk300 header just contains some initialization routines, defines and some functions like setLed(). I doubt it has anything to do with the problem but if you need the content of the file just ask.
Thank you