Author Topic: PIC18Fxx39 using Table Read Post Inc programming command(Solved)  (Read 1561 times)

0 Members and 1 Guest are viewing this topic.

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 825
PIC18Fxx39 using Table Read Post Inc programming command(Solved)
« on: September 30, 2016, 03:36:45 am »
When verifying a program, the TABLE READ POST INCREMENT automatically increments the Table Pointer to the next byte address to be read.

Question:  This command increments TablePointer Low. When this command is repeated until the increment reaches 256, does the TablePointerLow roll-over back to 0 and a carry propagate to increment TablePointer High?

Thanks in advance for your help, the Programming Specsheet is not clear about this.
« Last Edit: September 30, 2016, 08:54:40 am by SuzyC »
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 628
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
Re: PIC18Fxx39 using Table Read Post Inc programming command Question
« Reply #1 on: September 30, 2016, 08:34:23 am »
Question:  This command increments TablePointer Low.
It increments TBLPTR, which is a 21 bit register. So no, it doesn't wrap around.

Operation of TBLRD with post increment (PIC18Fxx39 manual page 249):-
Quote
(Prog Mem (TBLPTR)) -> TABLAT;
(TBLPTR) +1 -> TBLPTR;

To address the program memory, a pointer called Table Pointer (TBLPTR) is used.
The TBLPTR (a 21-bit pointer) points to each byte in the program memory.
 
The following users thanked this post: SuzyC

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 825
Re: PIC18Fxx39 using Table Read Post Inc programming command Question
« Reply #2 on: September 30, 2016, 08:54:13 am »
Thanks Bruce Abbott,

I didn't realize that this read-postinc programming-use command was also a runtime instruction that works in the same way and the detailed info about it was right under my nose in the 18Fxx39 SpecSheet instead of the programming Specsheet!

What threw me off is that most of the Programming Spec examples manipulating the TABLPTR divide the TABLPTR into Hi, Lo, and Upper bytes and these registers are loaded with address values individually.
« Last Edit: September 30, 2016, 09:17:49 am by SuzyC »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf