16F 18F bootloaders

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
Dxmaxim
Posts: 80
Joined: 30 Sep 2008 08:10
Location: South Africa
Contact:

16F 18F bootloaders

#1 Post by Dxmaxim » 14 Jul 2014 09:19

Hey All,

Can someone please recommend devices in the 20 PIN and 18 PIN packages either of the 16F1xx or the 18FxxKXX families which are bootloader capable or can work with the Mikroe Bootloader?

It would be greatly appreciated.

Thanks in advance

Michael
ZarDynamix | Fidelis et fortis semper
An embedded solutions company
Site | http://www.zardynamix.com

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: 16F 18F bootloaders

#2 Post by filip » 15 Jul 2014 15:21

Hi,

Basically, any MCU supported by the mikroC compiler which has UART module is qualified for the bootloader.

Regards,
Filip.

Dxmaxim
Posts: 80
Joined: 30 Sep 2008 08:10
Location: South Africa
Contact:

Re: 16F 18F bootloaders

#3 Post by Dxmaxim » 15 Jul 2014 15:50

Hi Flip,

Thanks for the response. I would have thought the same, however I attempted to refactor the boot-loader example for the PIC18F45K22 to the PIC18F24K22, now this is a 28 PIN device in the same family and when I did that I got a error message that there was not enough ram.

So my assumption is that a device needs a minimum amount of RAM before the boot-loader will function unless the code example can be further optimised.

. . . and this is the reason for my question :D
ZarDynamix | Fidelis et fortis semper
An embedded solutions company
Site | http://www.zardynamix.com

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: 16F 18F bootloaders

#4 Post by filip » 17 Jul 2014 16:35

Hi,

Well, you just need to have in mind the different memory sizes when using a bootloader.
Have a look at the defines from the beginning of the code and ensure that that have a good value.

Regards,
Filip.

Haven
Posts: 40
Joined: 18 Mar 2017 21:20
Location: South Africa
Contact:

Re: 16F 18F bootloaders

#5 Post by Haven » 20 Jul 2022 21:16

Hi Everyone,

I am in the process of updating the bootloader for the PIC16F887 to work with the PIC16f1827 /1847. Based on the message from Mikroe, since the F887 has 14K Words and 1827 7, I would just need to make that adjustment. But I honestly can't find the "defines" as mentioned in the reply.

So, for example in the snippet below, I am not sure if this is the right place to update the memory size for the PIC16F1827.

Also, I haven't been able to map or locate this address org 0x1DF2 in the PIC16F887 DataSheet, the plan being that I replace it with the equivalent for the PIC16F1827. Not sure if it is the right step either.

I have gone through the Microchip App note from the help file that the boot loader is based on, but I am at a bit of a loss on what to do from here. Any help would be appreciated.

Code: Select all

void Flash_Write_Address(unsigned beginorg)  org 0x1DF2 {

     unsigned total;
     unsigned temp;
     char loop;
     char SaveIntCon;

     loop = 0;
     while (loop != 32) {
          total = (beginorg << 5) + loop;
          temp  = block[loop];
          SaveIntCon = INTCON;
          EEADR   = (char)(total);
          EEADRH  = (char)(total >> 8);
          EEDATA  = (char)(temp);
          EEDATH  = (char)(temp >> 8);
          EECON1.EEPGD = 1;
          EECON1.WREN  = 1;
          INTCON.GIE   = 0;
          EECON2 = 0x55;
          EECON2 = 0xAA;
          EECON1.WR    = 1;
          asm nop;
          asm nop;
          INTCON = SaveIntCon;
          EECON1.WREN = 0;
          loop++;
     }
}
Michael A Havenga
HavenTechnik | SP
WEB: http://www.haventechnik.com
twitter: @HavenTechnik

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: 16F 18F bootloaders

#6 Post by filip » 21 Jul 2022 10:45

Hi,

Maybe you should take a look at the mikroC PRO for PIC\Examples\Other\Bootloader\P18F45K22\ example, it is much simpler to port this one to your target MCU.

Regards,
Filip.

Post Reply

Return to “mikroC PRO for PIC General”