Yes l did mean PCL...hehe Isnt there only one bank in a 16c84...?? I thought each bank was 2048k...no ?? PCH should be set to all 0's l presume...as the Program counter should never exceed this... Also l am only jumping about 10 bytes or so so l am definately within the 256 byte barrier... Any ideas ??? ----- Original Message ----- From: "Olin Lathrop" To: Sent: Friday, September 22, 2000 11:43 PM Subject: Re: [PIC]: Problem with PC in 16c84 / mplab ver 4.12 ?? > >> > 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... > << > > Two potential problems I can see. (Other than you meant to type PCL instead > of PC, right?) > > First, are you sure the proper register bank is selected for access to > LOCK_STATE? This is particularly suspicious because of the label since > anyone could jump there. > > Second, since you are not setting PCLATH, the target of where the ADDWF PCL > goes to must be in the same block of 256 instruction locations as ADDWF. I > am assuming that you are guaranteeing that LOCK_STATE never exceeds the jump > table size by other means not shown here. > > > ***************************************************************** > Olin Lathrop, embedded systems consultant in Devens Massachusetts > (978) 772-3129, olin@cognivis.com, http://www.cognivis.com > > -- > 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