EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

TBLPTR bug in MPLAB

Started by Eirik Karlsen March 27, 2004
Seems like MICROCHIP can't make up their mind on whether the PIC18 TBLPTR is 21 or 22 bits wide...
some places in the datasheet it says it is 21bits, other places it says 22bits.

I'm having trouble simulating this stuff.
The datasheet states that bit21 is used to access the config and id locations (bit22 and bit23 are not implemented).
However when I load FFh into TBLPTRU and put a watch on it it comes out with 1Fh....
The way I see this it should be 3Fh....otherwise one can't access the config bits.

Looks to me that this is a bug in MPLAB, and that they've truncated one bit too much (bit21)...
anyone have any experience with this oddity?
 

--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Best Regards
Eirik Karlsen
 


Can someone of you try this code snippet, place a watch on the TBLPTR and see if the TBLPTR
gets 3F FF FF or 1F FF FF  ????

**********************
 MOVLW 0XFF
 MOVFF WREG,TBLPTRU
 SETF TBLPTRH
 SETF TBLPTRL
**********************

Eirik Karlsen wrote:

Seems like MICROCHIP can't make up their mind on whether the PIC18 TBLPTR is 21 or 22 bits wide...
some places in the datasheet it says it is 21bits, other places it says 22bits.

I'm having trouble simulating this stuff.
The datasheet states that bit21 is used to access the config and id locations (bit22 and bit23 are not implemented).
However when I load FFh into TBLPTRU and put a watch on it it comes out with 1Fh....
The way I see this it should be 3Fh....otherwise one can't access the config bits.

Looks to me that this is a bug in MPLAB, and that they've truncated one bit too much (bit21)...
anyone have any experience with this oddity?

--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Best Regards
Eirik Karlsen
 


The 2024 Embedded Online Conference