16f687 - Where is the data stored?


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159

    Default 16f687 - Where is the data stored?

    I am using a 16f687 for a project. The datasheet says it has 2048 words of flash program memory and 128 bytes of SRAM.

    If I use the following commands to make an array:

    Code:
    BAR_PAT1  VAR BYTE[16]
    ARRAYWRITE BAR_PAT1, [1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0]
    Which type of memory is the 16 bytes written to? Program or SRAM? I haven't been able to figure it out on my own, and I need to know
    for another project.

    Thanks,

    Andy

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 16f687 - Where is the data stored?

    Written to SRAM as a variable.
    From the manual.
    Space for each variable is automatically allocated in the microcontroller=s RAM by PBP.
    ...
    Variable arrays can be created in a similar manner to variables.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: 16f687 - Where is the data stored?

    Quote Originally Posted by mackrackit View Post
    Written to SRAM as a variable.
    That's what I was afraid of..........guess there's an I2C EEPROM in my future!

  4. #4
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: 16f687 - Where is the data stored?

    Quote Originally Posted by andywpg View Post
    That's what I was afraid of..........guess there's an I2C EEPROM in my future!
    I'm curious how that might help. But if it does, would the onboard EEPROM (256 bytes) not be sufficient?

  5. #5
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: 16f687 - Where is the data stored?

    Quote Originally Posted by Charlie View Post
    I'm curious how that might help. But if it does, would the onboard EEPROM (256 bytes) not be sufficient?
    I have a BUNCH of 16 character messages (25+) that are to be displayed on an LCD. A master sends a command to a receiver (via RF) to light certain LED's, beep a piezo, and display various messages on the two lines of the LCD.

    My idea was to have the master send just a code indicating what message each line should display in the receiver, and have the receiver unit read the associated messages from the EEPROM and display it. Since that would involve having another part in each receiver (possibly 40 or more of them), I have since decided that the master will transmit the two lines of the message, so I will only have to use an external EEPROM in the master.

    Hopefully, my rambling explains the situation sufficiently...

    Andy

  6. #6
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: 16f687 - Where is the data stored?

    Why not store the messages as constant strings in program (FLASH) memory?
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  7. #7
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: 16f687 - Where is the data stored?

    Here is a thread about embedding your strings into code space:
    http://www.picbasic.co.uk/forum/showthread.php?t=1999
    http://www.scalerobotics.com

  8. #8
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: 16f687 - Where is the data stored?

    Thanks All! That helped a lot.

    I love this forum, there's always somebody who's smarter than me willing to help.

Members who have read this thread : 1

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