Storing data in Flash (Program) memory


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    May 2009
    Location
    Saint-Quentin-en-Yvelines, FRANCE
    Posts
    82

    Default Storing data in Flash (Program) memory

    Hello,

    I need to store two tables of data (32KB each) in the program memory.
    These data will be read by the program when running.

    I have found the way to store the data in EEPROM but not in the program memory.

    Any help greatly appreciated.

    The target is a 18F2685

    MikeBZH

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Here's one way ...

    Using EXT with Labels ...
    http://www.picbasic.co.uk/forum/show...php?t=3891#LAB

    hth,
    DT

  3. #3
    Join Date
    May 2009
    Location
    Saint-Quentin-en-Yvelines, FRANCE
    Posts
    82


    Did you find this post helpful? Yes | No

    Default

    Thank you Darrel for your help.
    I am going to try this

    Mike BZH

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Yikes! I just realized you wanted 64k of data.

    Do you have PBP 2.50?
    With PBPL the READCODE statements can work above 64k, as long as the address variable is a LONG.

    PBPW, can only READCODE up to the 64k barrier.

    It's also possible to access the memory above 64k without using readcode if you don't have PBP 2.50, but it's a little trickier.
    <br>
    DT

  5. #5
    Join Date
    May 2009
    Location
    Saint-Quentin-en-Yvelines, FRANCE
    Posts
    82


    Did you find this post helpful? Yes | No

    Default

    Yes, I have PBP 2.50b.
    So, it should work....

    Michel

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MikeBZH View Post
    Yes, I have PBP 2.50b.
    So, it should work....
    Yes it will. (using PBPL)

    With the EXT example I pointed to earlier, all you need to change is ...
    Code:
    Offset    VAR  LONG
    Even though Offset will never be greater than 65535, one of the parameters of the READCODE statement has to be a LONG.
    Since DataTable is a constant, the Offset variable gets the duty.

    I'm curious where the data is coming from.
    Obviously you won't want to create 64k worth of DW statements.

    Is the data in a file of some type?
    <br>
    DT

  7. #7
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: Storing data in Flash (Program) memory

    Hi darrel , having a read of this thread , what is as the size limits and format requirements are for the asm file include
    , I need to have about 2K of byte data for banner and font data

    i have table of data , which are 240 bytes long with 64 lines per , taking up about 2k per banner

    regards

    Sheldon

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Storing data in Flash (Program) memory

    PBP3 increased the ASM block size from 4K to 64K of text.
    So this thread doesn't really apply when it comes to how much code you can put in an ASM block.

    The only real limitation now is how much code space is available in your chip.
    DT

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts