+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Member level 4
    Points: 2,095, Level: 10
    Achievements:
    7 years registered

    Join Date
    Feb 2006
    Location
    Norway
    Posts
    79
    Helped
    0 / 0
    Points
    2,095
    Level
    10

    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?

    •   Alt17th July 2006, 19:29

      advertising

        
       

  2. #2
    Full Member level 2
    Points: 5,838, Level: 18

    Join Date
    Jun 2005
    Location
    Michigan, USA
    Posts
    129
    Helped
    19 / 19
    Points
    5,838
    Level
    18

    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



    •   Alt17th July 2006, 20:25

      advertising

        
       

  3. #3
    Full Member level 4
    Points: 3,024, Level: 12

    Join Date
    Jun 2004
    Posts
    229
    Helped
    16 / 16
    Points
    3,024
    Level
    12

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



--[[ ]]--