Shop OBEX P1 Docs P2 Docs Learn Events
How to I save data in internal flash memory ? — Parallax Forums

How to I save data in internal flash memory ?

loojadeloojade Posts: 30
edited 2008-02-18 23:49 in General Discussion
hallo everyboby,

I'm new with parallax and SX micro. I want to say sorry for my bad english...

This is my problem:
In a Sx application I would like to save some datas in internal Flash memory. It's possible keep data into the Flash or I have to use a external EEPROM.
If It's necessary a external EEPROM someone can tell me something about...
Thanks in advance.

Loojade

[noparse][[/noparse]edit] I added a subject to your post. Bean.

Post Edited By Moderator (Bean (Hitt Consulting)) : 2/16/2008 1:39:32 AM GMT

Comments

  • JonnyMacJonnyMac Posts: 9,217
    edited 2008-02-16 01:27
    You cannot write to the internal flash at run time; you'll need to use an external EEPROM or equivalent device.
  • loojadeloojade Posts: 30
    edited 2008-02-16 13:02
    Thanks for your reply. Any suggest about the device I can use with SX...
  • JonnyMacJonnyMac Posts: 9,217
    edited 2008-02-16 15:37
    That depends on how much data you need to save. I use the 24LC256 (32K) and 24LC512 (64K) quite a bit. Remember that I2C is an addressable buss, so you can actually have up to eight of these devices (i.e., you could easily have 8 x 64K).
  • loojadeloojade Posts: 30
    edited 2008-02-16 17:23
    In my application I need to save only few bytes (10 variable as word). So I looking for a very easy to interface device.
    Thanks
  • JonnyMacJonnyMac Posts: 9,217
    edited 2008-02-16 18:35
    I2C is I2C, so the physical connections are the same. I find the 24LC32 and bigger easiest to interface (code-wise) as the addressing is straightforward. Some of the smaller devices do weird things with the slave ID byte. The SX/B help file shows how to connect to a 24LC16B; if you look at the code carefully you'll see that part of the internal addressing is sent in the slave ID byte.
  • loojadeloojade Posts: 30
    edited 2008-02-16 19:26
    good!!!
    I can use the code of help file...
    Thanks a lot
  • loojadeloojade Posts: 30
    edited 2008-02-16 19:39
    One more question... What you mean with "weird things"!!!???
  • JonnyMacJonnyMac Posts: 9,217
    edited 2008-02-16 20:23
    What I mean is that the slave ID get used for more than just the slave ID (which usually contains the device type and device address). It would really be best for you to just start reading up on I2C; it's a handy tool to have for more than just saving data as there are lots of interesting chips (e.g., ADCs, I/O port expanders, etc.) that connect via I2C.
  • John CoutureJohn Couture Posts: 370
    edited 2008-02-16 21:47
    If you only need a couple of bytes of memory and your project has an Real Time Clock like DS1307 or PCF8583, they too have some memory in there you can address (56 in the first and a little over 200 in the latter). Again, though, you will have to learn the I2C protocol.

    Pick up a Professional Dev Board and practice on the DS1307 (that's what I have been doing this weekend for a class lesson plan). Code is in another thread just posted under the heading "DS1307 Demo"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • loojadeloojade Posts: 30
    edited 2008-02-18 08:20
    I'm so sorry about the many question I have...
    One more question: I write some code to test the SX-KEY. When I run the code, the SX-key tell me that I exceed the memory space!!!
    Totally RAM should be 132Byte???

    this is the code:

    [code]

    '
    ' Program Description
    '
    '
    ' GRIPOne
  • JonnyMacJonnyMac Posts: 9,217
    edited 2008-02-18 17:13
    You exceeded the space on the global page; you can move your counter variables to an array to free up global (BANK 0) space.
  • loojadeloojade Posts: 30
    edited 2008-02-18 23:35
    Could you tell me some more about this... I'm not sure to understand... burger.gifburger.gifburger.gif
  • JonnyMacJonnyMac Posts: 9,217
    edited 2008-02-18 23:47
  • loojadeloojade Posts: 30
    edited 2008-02-18 23:49
    Thanks a lot...
    It's very clear now tongue.giftongue.gif
Sign In or Register to comment.