PDA

View Full Version : 16f690 doesn't work with second Page



ArmFpc
- 24th June 2015, 16:18
Hi community,

I have a problem with my PIC 16F690. My program is now 2000 lines tall, and now I must use the second page. Normally it shout be no problem, but in my case it is.

The problem is that if I programming my pic with the source code form the MPLAB then the Pic doesn't work correctly. In the debugger of MPLAB it works correct.

I specify the second page at the program memory (org 0x800). When I'm looking in the listingfile, then i see that the source code of the second page is located at 0x800 forward.

Has someone a idea why it doesn't work in the physical Pic but in the debugger? or what is may mistake ?

cheers

aerostar
- 25th June 2015, 18:23
I have scanned very quickly ! the data sheet and done a Google (Piclist), are you setting the registers needed to point to page 2 directly before you do a call to code there, and presumably, vice versa when going back to page 1. Some of your code would be helpful.

Acetronics2
- 25th June 2015, 19:36
PBP takes care of paging ...

soooo, may be wrong forum for this kind of behaviour ??? :D

Alain

ArmFpc
- 1st July 2015, 14:30
Hi Guys thanks for the response!

befor I change to another page I do pagesel "name of function" (page 2) and after a return I do an pagesel to page 1. At the end of page 1 i declare with org 0x800 the program memory for the second page.

org 0x800
#include <Main_Init.inc>

Everything after this lines is on the second page, right ? So all program code which is called will be called with pagesel, alternative with lcall.

That is an example for a call to the second page.
pagesel Init_ALL
lcall Init_ALL ; initialized all important registers
pagesel $

What is wrong on my version ??