Hello all.
I have only been programming the PIC16F628A for a few weeks and am experiencing a problem for which I can find no answer. I have searched the forums extensively but no-one else seems to have had this one. I would appreciate any help that can be given.
The problem is this:
If I call a table or a subroutine, and the object of the call is not in the same 256-byte section of memory, instead of returning on the RETURN or RETLW instruction it just seems to step through all succeeding instructions after the RETURN or RETLW, WITHOUT ACTUALLY EXECUTING THEM and never returns to the calling instruction.
Putting in PAGESEL directives only induces a message from MPASM saying that "the device does not need these directives as there is only one page in this device". If I have the call and the object of the call in the same 256-byte section of memory it works fine. I just cannot find any reference to this problem anywhere.
I have implemented the code shown in AN556 but it doesn't make any difference.
As far as I can see, having looked at the Microchip forum, and all other forums, help pages, etc, the problem usually associated with this is the the RETURN or RETLW jumps to some strange place because PCLATH is not set properly.
This is not the problem I am having, it just doesn't execute anything after going to the called subroutine.
Can anyone help with this please?