Pic16f tables bigger than 256

Status
Not open for further replies.

pixman

Member
Hi
i would like to know how you would set out tables if they are morre than 255
i have read that if you have tables, they should not cross the 255 mark.
I have a program that has 5 tables, the 5th table cross this 255 area and when
i use this table it does not work properly.

Help please
DAVID
 
I HAD A LOOK AT THE 4 TUTORIALS.
IT STILL DOES NOT MAKE SENSE TO ME.
CAN I USE
org 0X100
AFTER TABLE 4 TO PUT IT IN A NEW 256 AREA
 
You can certain use ORG to place tables at specific places, and my earlier tutorials do that. But it's tutorial 13 that uses tables larger than 256 bytes.
 
Place Table 5 at location 200h by using the instructions:
org 0x200
table5 addwf pcl,f
retlw .5
retlw 0ffh etc

in your main program, add:

movlw 02
movwf PCLATH
movlw jump value for table 5
call table5
 
Tables in baseline PIC chips can only be placed in the first 256 addresses of memory.
 
Last edited:
So would i be correct in saying that for 16f628a
start: 0x005
next : 0x200
0x400
0x600
end: 0x7ff
that is how you put tables in different places

and for the 16f877a the same would apply but continued for page 1 to page 3
 
It's one way, not forgetting to do the PCLATH switching as post #7.

Or you could use large tables, and ignore the switching - as my tutorial 13 does.
 
I have had a good look at tutorial 13 and i can't seem to figure it out.
I will play with it in mplab to see if i can understand what you did.

Thank you for your help
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…