Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help with large lookup table

Status
Not open for further replies.

zanor

Member level 4
Joined
Feb 17, 2006
Messages
79
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Norway
Activity points
2,039
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? :roll:
 

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;



Good luck. Regards, Mike
 

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 :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top