Well l am doing the same routine many times before this location with no problems...l only have 1024k so l shouldnt be needing to page in a 16c84...thanks for the suggestions though l will try it but l dont think it is the proiblem... ----- Original Message ----- From: "Martin Hill" To: Sent: Saturday, September 23, 2000 12:14 AM Subject: Re: [PIC]: Problem with PC in 16c84 / mplab ver 4.12 ?? > I have just had a similar problem, read application AN556, which > explains how tables work, basically you must set all the upper bits > of the PC register (PCLATH) as when you add to the PCL it will use > these upper bits. So I think it should look more like: > > > LOCK_BEGIN > MOVF HIGH LOCK_BEGIN,W > MOVWF PCLATH > MOVF LOCK_STATE,W > > ADDWF PC > > GOTO LOCK_HALT > > GOTO LOCK_WAIT > > GOTO LOCK_TIMER > > Read the App Note, it explains it better than me. If you don't set the > bits you are probably jumping to an address at the start of the > current 2k block of code. > > > Martin > > > > > I have the following problem...when l add to the pc counter at about 144H it sends me to the wrong spot... > > > > now forgive me if l am wrong but isnt the 16cXXX series meant to fix that jump bit stuff so that l dont have to set the page bits etc...?? > > > > this is the code > > > > LOCK_BEGIN MOVF LOCK_STATE,W > > ADDWF PC > > GOTO LOCK_HALT > > GOTO LOCK_WAIT > > GOTO LOCK_TIMER > > > > lock_state = 1 and it sends me back to god knows where...but always the same spot... > > l suspect MPLAB as it has many bugs...does anyone know what is happening...it is quite urgent...thank you > > > > Paul Drummond > > geniesys@alphalink.com.au > > > > -- > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > use mailto:listserv@mitvma.mit.edu?body T%20PICList%20DIGEST > > > > > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST