B
Bill Bowden
I'm not understanding the PCLATH function to set the ROM memory space
for a PIC16F628 (2K) to some 256 byte boundary.
I have various data tables located in various sections of the ROM
memory space and can access the tables in the lower four 256 byte
pages. But problems arises when I try to access a table located above
the 1024 byte ROM boundry. I am setting the desired page with a hard
number loaded into the PCLATH register which seems to work fine with
lower boundaries of 0-1024. In other words, I load PCLATH with 0 for
address space 0-256 and 1 for space 256-512 and 2 for address space
512-768 and 3 for addresses 768 to 1023. But it doesn't seem to work
for page 4 which is 1024 to 1280.
However, stepping the program with MPLAB seems to work and everything
appears to work well until I load the program into the PIC which then
crashes when the call is made to the far address above 1023.
I suspect some of the higher bits of PCLATH need to be set, to call
far addresses above 1023 but I can't find the exact descriptions from
the data sheet.
It's still strange MPLAB would indicate things working right when the
result is something else.
-Bill
for a PIC16F628 (2K) to some 256 byte boundary.
I have various data tables located in various sections of the ROM
memory space and can access the tables in the lower four 256 byte
pages. But problems arises when I try to access a table located above
the 1024 byte ROM boundry. I am setting the desired page with a hard
number loaded into the PCLATH register which seems to work fine with
lower boundaries of 0-1024. In other words, I load PCLATH with 0 for
address space 0-256 and 1 for space 256-512 and 2 for address space
512-768 and 3 for addresses 768 to 1023. But it doesn't seem to work
for page 4 which is 1024 to 1280.
However, stepping the program with MPLAB seems to work and everything
appears to work well until I load the program into the PIC which then
crashes when the call is made to the far address above 1023.
I suspect some of the higher bits of PCLATH need to be set, to call
far addresses above 1023 but I can't find the exact descriptions from
the data sheet.
It's still strange MPLAB would indicate things working right when the
result is something else.
-Bill