Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Program ROM usage across pages

Status
Not open for further replies.

FlipFlops

New Member
I'm using HT PICC 8.05 with MPLAB, and noticed that the instructions are allocated quite oddly throughout the program memory space. For instance, it will fill memory locations 01E8-04A8, and then 04A9-07FF (the end of Page 0), but then there's a huge gap of unused program memory until 0D6E, almost 1400 words left unused.

Why does this bother me? Well, I'm trying to fit a bootloader at the end of the program memory space, from 0F00-0FFF, the last 256 words, but since the gap at 07FF-0D6E is empty, my program overflows into the reserved space I need.

Is there a reason the compiler does this? I don't understand why the first 1400 words of the Page 1 memory block would be left empty.

I've tried using the -resrom0F00-0FFF option, but it doesn't seem to help.
 
I'm not familiar with the compiler you mention but wonder if maybe it fills memory backwards. It is sometimes usefull to fill memory from zero up and from the top down. One portion of code may be run time routines while the other may be complied user code. Whatever the reason, I would be very supprised if it wasted the space.

You also mention "reserved space". Suggesting that your memory space goes beyond 0fffh. If this is the case and you use a boot program then you will probably find that 0 - 0fffh is code protected and the bootloader only loads to the higher locations.

HTH

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top