Pic16F15324 Bootloader(MikroBootloader tool)

General discussion on mikroPascal PRO for PIC.
Post Reply
Author
Message
axem
Posts: 5
Joined: 01 Jun 2018 07:21

Pic16F15324 Bootloader(MikroBootloader tool)

#1 Post by axem » 20 Jul 2018 08:49

Hi all,

I am using Pic16F15324 with Internal Clock at 32MHz ( IDE 7.2.0 ).
I did some test at first by doing classic LED Blinking and that works
Thanks to Janni to solve trouble on UART and main application is working well. Now i need to develop bootloader via UART. To do that i am using bootloader for PIC16 provided in example library. As you know this bootloader has beed defined for flashing EEROM not Flash Mry. Anyway concept is more or less similar and i am readapting it to FLASH mry instead of EEROM management.
A trouble occured : Transfert per 4 words seems don't match with correct MRY address. Tansfert seems be correct but DATA are not where they must be.

In attachment a ZIP file of the project including "MRY_Mapping" after complete Flash ( i uploaded MRY by using Pickit3 ). I have Flashing/uploaded my own Bootloader software.

Thanks in advance for support,
Best regards.
Attachments
Pic16F15324_Bootloader.zip
(104.17 KiB) Downloaded 124 times

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Pic16F15324 Bootloader(MikroBootloader tool)

#2 Post by janni » 23 Jul 2018 00:00

This processor's flash is arranged in rows of 32-words so erasing and writing has to be done in blocks of this size.

axem
Posts: 5
Joined: 01 Jun 2018 07:21

Re: Pic16F15324 Bootloader(MikroBootloader tool)

#3 Post by axem » 23 Jul 2018 08:07

hello Janni,

Nice to reading you.
Could you confirm that Flash_Erase and Flash Write for PIC16 from Flash library are not usefull for doing my bootloader? Best way that would be to use Flash_Erase_Write function but this one is dedicated for PIC18.
I read in Datasheet to work in 32 words in row like you said and i think i will need to develop an ASM subsroutine for ERASE and WRITE like described in chapter 13.0. It is right or maybe something more or less close what i need is already existing?

Thanks.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Pic16F15324 Bootloader(MikroBootloader tool)

#4 Post by janni » 23 Jul 2018 13:18

axem wrote:Could you confirm that Flash_Erase and Flash Write for PIC16 from Flash library are not usefull for doing my bootloader?
These functions should work. I had a look at them and Flash_Write is adjusted to row of 32 words write. One caveat is that both functions may be dangerous as they call a routine that enables interrupts (though it was pointed out years ago, this quirk returns with every new processor implemented :roll: ). Theoretically, all interrupts are disabled at reset for this processor but it's best to make sure and disable them all manually (clear INTCON and PIEx registers).

axem
Posts: 5
Joined: 01 Jun 2018 07:21

Re: Pic16F15324 Bootloader(MikroBootloader tool)

#5 Post by axem » 23 Jul 2018 14:53

Thanks Janni,

To be honest i am not sure that i have well understood your answer. Can i use function dedicated to PIC18 like Flash_erase_write_64 or others Flash functions for PIC18 on my Pic16F15324? Or just stay focused on Flash functions dedicated to Pic16F?

I am not an expert of Pic and i am little bit worried for doing this bootloader but i need one by using serial transfert. Maybe i should use another one developped by other person or company. Any idea?

Anyway i will try to do according your feedback and hope you will continue to advice me.

Best regards.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Pic16F15324 Bootloader(MikroBootloader tool)

#6 Post by janni » 23 Jul 2018 16:31

When you choose the PIC16F15324 processor, the IDE displays available library functions in Library Manager. And I meant these functions, namely Flash_Erase and Flash_Write. There's no need to search for PIC18 functions - and they're not compatible, anyway.
Maybe i should use another one developped by other person or company.
If you find ready to use bootloader then it'll be certainly easier for you - it does not even have to be written for mE compilers as it's usually a separate program that loads a hex file. Maybe Microchip has something available.

Post Reply

Return to “mikroPascal PRO for PIC General”