P-star 25k50 bootloder recovery?

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);

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.


Since you uploaded the program using the bootloader and the p-load utility, the bootloader should still be present on the P-Star. The P-Star can only run one program at a time, so if it is running your application, then it will not be running the bootloader, and the bootloader will not be recognized by the computer. You should be able to run the bootloader by following the instructions in the “Getting into bootloader mode” section of the P-Star 25K50 Micro user’s guide.

By the way, I added [code ] and [/code ] blocks (without the spaces) to make the code in your post more readable.


Thank you, David.