I’ve just tried my p-star via MPLABX and p-load.
I wrote the folowing program (copied from the user’s guide) :
[code]#include <xc.h>
#define _XTAL_FREQ 48000000
#define LED_GREEN(v) { TRISB7 = !(v); }
#define LED_YELLOW(v) { TRISB6 = !(v); }
#define LED_RED(v) { TRISC6 = !(v); }
void main() {
// Set up the LEDs
LATB7 = 1;
LATB6 = 1;
LATC6 = 0;
/* Enable Timer 0 as a 16-bit timer with 1:256 prescaler: since
the instruction speed is 12 MHz, this overflows about every 1.4seconds. */
T0CON = 0b10000111;
while (1) {
TMR0L; // trigger an update of TMR0H
// Blink the green LED with a period of 1.4 s
LED_GREEN(TMR0H >> 7 & 1);
// Blink the yellow LED with a period of 0.7 s
LED_YELLOW(TMR0H >> 6 & 1);
// Blink the red LED with a period of 0.35 s
LED_RED(TMR0H >> 5 & 1);
}
}
[/code]
The program works and the leds are blinking, but … from now on p-load does not recognize the p-star bootloader.
I’d set the offset for my code to 0x2000 (as advised in the user’s guide). Is there a way to recover the bootloader?
Is there a way to download it. I asume that it would have to be send to the controller via PICKit3 programer.
Please feel free to give me appropriate advices.