Shop OBEX P1 Docs P2 Docs Learn Events
Has Anyone Used the 'Heap' Object? — Parallax Forums

Has Anyone Used the 'Heap' Object?

lardomlardom Posts: 1,659
edited 2010-09-29 00:15 in General Discussion
I'm trying to get an idea of how this obex object is used. I want to learn how to reserve a physical block of eeprom memory say, for example, $4fff to 6fff to store data. I'm studying different objects but I haven't seen an object that specifies a block of hex addresses for data storage. This is what I think I should be looking for.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-28 11:15
    It doesn't really work the way you think. The Heap object provides management for a block of HUB (RAM) memory, not EEPROM.

    The 1st 32K bytes of EEPROM are the territory of the Propeller Tool (or BST). The whole 32K is changed when you download a new program to the EEPROM. Everything beyond the end of the program is zeroed. If you don't download a new program, you can use whatever portion of the 1st 32K of the EEPROM is not actually used by your program. Typically, this is from the end of the 32K down to the start of the stack area. Again, this gets erased when you download a new program.

    If you have an EEPROM larger than 32K, everything beyond the 1st 32K is yours. You can do whatever you want with it and the Propeller Tool won't touch it. There are objects in the Propeller Object Exchange that will let you read and write to the EEPROM.
  • lardomlardom Posts: 1,659
    edited 2010-09-28 11:31
    Thanks Mike. I am wondering if I could have a variable array with maybe 200 elements and cycle through them as a form of wear-leveling. It occurred to me while studying the memory map that I could expand and use the 'yellow' area that's reserved for variables. (Don't laugh. It takes me a while to see things) In this case I wouldn't have to write out hex addresses.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-09-29 00:15
    You can add more EEprom and then reach it through PASM. The wear leveling design would be up to you.

    I think you would need to look at I2C objects.
Sign In or Register to comment.