I do not exactly understand how the program memory is set up in terms of paging.
Each page in the PIC16 can store 2048 instructions, and there are 4 such pages in total. I read that when a certain instruction being executed is past the 2048 line boundary, I need to set bits 3 and 4 of the PCLATH appropriately.
At the moment, the only thing I can think of is adding nop (skip/do nothing instructions) such that none of my subroutines contain code that lies in two pages. The only way I can currently determine whether an instruction (or subroutine) is on another page is by looking at the program memory in MPLAB (the IDE I'm using).
I was simply wondering if anyone could provide me with any more insight in this subject? Is there something I'm missing? Is there a conventional way of paging that I should be following?
Each page in the PIC16 can store 2048 instructions, and there are 4 such pages in total. I read that when a certain instruction being executed is past the 2048 line boundary, I need to set bits 3 and 4 of the PCLATH appropriately.
At the moment, the only thing I can think of is adding nop (skip/do nothing instructions) such that none of my subroutines contain code that lies in two pages. The only way I can currently determine whether an instruction (or subroutine) is on another page is by looking at the program memory in MPLAB (the IDE I'm using).
I was simply wondering if anyone could provide me with any more insight in this subject? Is there something I'm missing? Is there a conventional way of paging that I should be following?