| Author |
Message |
zanor
Joined: 17 Feb 2006 Posts: 77 Location: Norway
|
17 Jul 2006 19:29 Re: Need help with large lookup table |
|
|
|
|
Hi!
I'm trying to make a lookup table for a LED sign I'm making (hardware done, test program done and working).
5x4 characters.
But then I 1280(256x5) byte big lookup table.
I have read somewhere that I need to alter the PCLATCH register.
Any help would be great!
Or if anyone know of a better method of doing this?
EDIT: BTW i'm using 16F648a, and assembly language.
Added after 1 hours 29 minutes:
I have been reading alot now and I think I know some more now.
Please correct me if I'm wrong.
If I load 0x06 into PCLATCH and then 0xAB into PCL will it then go directly to 0x06AB?
But if I use a GOTO or CALL command, where does the 8-10 bits of PC come from?
Or does it just find those bits by it self?
|
|
| Back to top |
|
 |
Google AdSense

|
17 Jul 2006 19:29 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
Mike, K8LH
Joined: 06 Jun 2005 Posts: 130 Helped: 16 Location: Michigan, USA
|
17 Jul 2006 20:25 Re: Need help with large lookup table |
|
|
|
|
Yes, as soon as you write that value into PCL you'll go to that address at 06ABh.
The call and goto instructions use the complete target address (up to the 2k "page" boundary) so you do not need to mess with PCLATH until you start writing code that crosses those 2k boundaries (800h, 1000h, etc.).
BTW, there's some example code in the following thread that shows one method for manipulating PCLATH:PCL correctly so that your tables can be larger than 256 words and can straddle 256 word boundaries without problems;
http://www.edaboard.com/ftopic181306.html
Good luck. Regards, Mike
|
|
| Back to top |
|
 |
haytham
Joined: 06 Jun 2004 Posts: 225 Helped: 14 Location: Egypt
|
17 Jul 2006 23:14 Re: Need help with large lookup table |
|
|
|
|
ORG directive will male you start writing from certain addres son flash memory
problem is that you will need to djust page select bits when need to call function in another memory page.
Typically change page select bits brfore using "call" and "goto".
Wlecome any time
|
|
| Back to top |
|
 |