Tutorial (8): Creating arrays using lookup tables in PIC microcontrollers

1 month ago
115

A look-up table is a block of data that is held in the program memory and which can be accessed by the program and used within it.
The table is formed as a subroutine.
Every byte of data in the table is accompanied by a special instruction retlw.
As it implements the subroutine return, it picks up its operand and puts it into the W register.
We use something called ‘computed go to’ using the instruction addwf pcl.
The contents of the W register are added to pcl, which is the lower byte of the program counter.
Once a number has been added to the program counter, program execution jumps forward by whatever that number was

Loading comments...