Hello!
In MP v 7.6.0, I received that message, on pic 16F1788. Last ok compilation was about 5.7K words, about 1300 lines, main program about 500 lines.
I just added some more code in main program and received this message. What it means? There is a "page size" for a procedure or main program? If yes, what is this size?
Thanks
Jose (A long time I do not come to the forum.... sorry for that!
edit: seems to me that the max. size a routine or main can have is 2048 bytes = 1024 words. If so, why?
Jose
message: function size exceeds page boundaries [main]
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: message: function size exceeds page boundaries [main]
Hi,
The program memory in PIC microcontrollers is segmented into pages due to limitations in the program counter's capacity to address the entire memory space.
In instances where a program exceeds the size of one page, it may traverse into adjacent pages, leading to program counter overflow.
To resolve this issue, you will need to adjust the PCLATH register.
I advise that you study the datasheet, particularly those concerning Program Memory Organization, PCL and PCLATH, and Program Memory Paging, all located under the Memory Organization main topic.
https://ww1.microchip.com/downloads/aem ... 01675C.pdf
Regards,
Ivan.
The program memory in PIC microcontrollers is segmented into pages due to limitations in the program counter's capacity to address the entire memory space.
In instances where a program exceeds the size of one page, it may traverse into adjacent pages, leading to program counter overflow.
To resolve this issue, you will need to adjust the PCLATH register.
I advise that you study the datasheet, particularly those concerning Program Memory Organization, PCL and PCLATH, and Program Memory Paging, all located under the Memory Organization main topic.
https://ww1.microchip.com/downloads/aem ... 01675C.pdf
Regards,
Ivan.
Re: message: function size exceeds page boundaries [main]
Thanks Ivan.
I solved that taking parts of the main program and converting into procedures. At the end, this is a better programing practice, anyway....
I solved that taking parts of the main program and converting into procedures. At the end, this is a better programing practice, anyway....
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: message: function size exceeds page boundaries [main]
Glad you managed to solve the issue.
If you have further questions you can always contact us.
Regards,
Ivan.
If you have further questions you can always contact us.
Regards,
Ivan.