electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Need help with large lookup table


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Need help with large lookup table
Author Message
zanor



Joined: 17 Feb 2006
Posts: 77
Location: Norway


Post17 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? Rolling Eyes
Back to top
Google
AdSense
Google Adsense




Post17 Jul 2006 19:29   

Ads




Back to top
Mike, K8LH



Joined: 06 Jun 2005
Posts: 130
Helped: 16
Location: Michigan, USA


Post17 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


Post17 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 Smile
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Need help with large lookup table
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
lookup table with CPLD or FPGA? (2)
sine lookup table with 16 bit value... (8)
[HELP] power lookup table in synopsys .lib (5)
lookup table in vhdl? (2)
Question about lookup table in VHDL (6)
boolean equations from lookup table (1)
How to ;LookUp table constants in 89c52 (4)
LUT(lookup table) in FPGA can be implemented in ASIC? (5)
How2 define all the string into a lookup table?? (7)
cartesian to polar and polar to cartesian lookup table (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS