Hi
This is the first time I reach about 550 instruction set in 16F877
But it started causing troubles
My code is about several subroutines called from the main program
At the beginning of the project I was adding the code piece after piece
And make a test after adding every sub routine
(all the subroutines are working well individually)
But when added the last piece of code it dose not work
When moving it after the main program
It works but leaving the last piece of code not working!
I thing it's a matter of paging the program memory
I do not know how to deal with PCLATH register
and my whole program will not exceed 700 instruction set
If your code is not going to exceed 700 instructions then it will fit in one bank. The bank size if 2048 (0x800) instructions. It is more likely that a table is moving and crossing a page boundary. Look for any access to PCL and check that the table that follows is all in one page - IE has the same high byte in the address.
If your code is going over 2k then you can call subroutines in the far bank by doing the following,