PIC18f4550 + tinybootloader
Posted: Mon Mar 07, 2016 3:28 pm
Hi,
I'm using XC8 and PIC18f4550 with tinybootloader on it.
Since I'm just learning some basic stuff, I'm trying to compile and upload some sample projects (simple led blinking) that I've found online. Below is the code I'm trying to build and upload via tinybootloader. However when I build and try to upload the hex file, I'm getting the following error:
While I was searching online for some similar cases I found that the problem occurs because the hex file is trying to occupy bootloaders place (my understanding of tinybootloader is that it stores GOTO at the beginning and points to the end of the PIC memory so it leaves the rest for any other application). I've tried to add an offset in the project properties->XC8 linker->memory model under RAM ranges. After that the error message changes to:
That tells me that I'm on a good track, but I'm not really sure how to proceed, I've tried some other examples of GOTO function but without any luck (although I've seen the changes in HEX files with and without it, but the error remains the same).
I would appreciate any sort of help or guidance regarding this. Thanks in advance.
I'm using XC8 and PIC18f4550 with tinybootloader on it.
Since I'm just learning some basic stuff, I'm trying to compile and upload some sample projects (simple led blinking) that I've found online. Below is the code I'm trying to build and upload via tinybootloader. However when I build and try to upload the hex file, I'm getting the following error:
Searching for PIC ...
Found:18F 2550/4550
Overwriting bootloader denied
ERROR!
While I was searching online for some similar cases I found that the problem occurs because the hex file is trying to occupy bootloaders place (my understanding of tinybootloader is that it stores GOTO at the beginning and points to the end of the PIC memory so it leaves the rest for any other application). I've tried to add an offset in the project properties->XC8 linker->memory model under RAM ranges. After that the error message changes to:
Searching for PIC ...
Found:18F 2550/4550
WARNING: GOTO not found in first 4 words
Overwriting bootloader denied
ERROR!
That tells me that I'm on a good track, but I'm not really sure how to proceed, I've tried some other examples of GOTO function but without any luck (although I've seen the changes in HEX files with and without it, but the error remains the same).
I would appreciate any sort of help or guidance regarding this. Thanks in advance.
- Code: Select all
#include<p18f4550.h>
#pragma config PLLDIV = 5 , CPUDIV = OSC1_PLL2 , USBDIV = 2
/* *************** TIMER *************** */
void delayzz(void)
{ int i, j;
for(i=0;i<5000;i++)
{
for(j=0;j<2;j++)
{ } } }
/* ****************** MAIN ****************** */
void main(void)
{
TRISB = 0 ;
while(1)
{
LATBbits.LATB0 = 1; // RB-1 to High
LATBbits.LATB1 = 1; // RB-1 to High
delayzz();
LATBbits.LATB0 = 0; // RB-0 to LOW
LATBbits.LATB1 = 0; // RB-0 to LOW
delayzz();
}
}