Shop OBEX P1 Docs P2 Docs Learn Events
Please help me clarify Prop hex editor and the 24lc256. — Parallax Forums

Please help me clarify Prop hex editor and the 24lc256.

Zap-oZap-o Posts: 452
edited 2011-01-18 08:16 in Propeller 1
So to start the 24LC256 data sheet states that its 32K x 8(256 Kbit). Does this mean 32K columns that can store 8 bits of data? and is K = 1024 in this situation?

I imagine it as this crude picture. each cell contains 8 bits.
mem.jpg


Second the prop manual states the propeller has 64k bytes: 32KB Ram + 32KB ROM. and 512 x 32bits in COG RAM. To better understand memory I thought that the hex editor would be a great start.

Seeing that the top row is 16 bytes it starts out as 00 but then jumps to B4 and C4... What's going on here? Is that the data or is it the addressing?
memory.jpg


Ultimately I want to store data in the 24LC256 and not "overwrite the stack". So I need to know when the propeller code ends because that will be here my storage data can begin.
898 x 538 - 144K
799 x 365 - 33K

Comments

  • SapiehaSapieha Posts: 2,964
    edited 2011-01-18 07:40
    Hi Zap-o.

    If You use that written EEProm with REBOOT Propeller it not preserve Stack space. Every time Propeller reboot from EEProm it loads entire EEProm area 32KB in RAM area.



    Zap-o wrote: »
    So to start the 24LC256 data sheet states that its 32K x 8(256 Kbit). Does this mean 32K columns that can store 8 bits of data? and is K = 1024 in this situation?

    I imagine it as this crude picture. each cell contains 8 bits.
    mem.jpg


    Second the prop manual states the propeller has 64k bytes: 32KB Ram + 32KB ROM. and 512 x 32bits in COG RAM. To better understand memory I thought that the hex editor would be a great start.

    Seeing that the top row is 16 bytes it starts out as 00 but then jumps to B4 and C4... What's going on here? Is that the data or is it the addressing?
    memory.jpg


    Ultimately I want to store data in the 24LC256 and not "overwrite the stack". So I need to know when the propeller code ends because that will be here my storage data can begin.
  • Zap-oZap-o Posts: 452
    edited 2011-01-18 07:43
    True that is why I need to know the end of my propeller code. I can take advantage of this by the following
    Var 
    Long Temps
    
    Pub GetEeprom
    
    Temps := GetEEpromdaata(address,type)
    
  • Mike GreenMike Green Posts: 23,101
    edited 2011-01-18 07:49
    Each row in the hex editor shows you 16 bytes of memory. The address of the first byte of each row is shown in the left-hand column and starts with zero (0000). The first 16 byte of memory contain information for the Spin interpreter. For example, the first 4 bytes contain the value of CLKFREQ (00 B4 C4 04). Values greater than a byte in size are stored in memory with the least significant byte first, so this is the number $04C4B400 which is 80_000_000.

    On the left-hand side of the editor, there's a graph showing how memory is used. The area marked Stack / Free shows where the stack begins in memory and extends to the end of memory. In the EEPROM, this area is not used and is initialized to zero. You can use this area of the EEPROM for your own data. Keep in mind that, when you download a new program to the EEPROM, this area will be erased. Most people who store data in the EEPROM, start at the end of memory ($7FFF) and work back towards location zero.
  • SapiehaSapieha Posts: 2,964
    edited 2011-01-18 07:50
    Hi Zap-o.

    Look in OBEX after Mike Green --- Basic (Written in Spin) that use area after code as program storage. That can help You much


    Zap-o wrote: »
    True that is why I need to know the end of my propeller code. I can take advantage of this by the following
    Var 
    Long Temps
    
    Pub GetEeprom
    
    Temps := GetEEpromdaata(address,type)
    
  • Zap-oZap-o Posts: 452
    edited 2011-01-18 07:53
    Mike Huge help thanks!
    Sapieha - ill take a look.

    Thanks fellas.
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-01-18 08:00
    What he means is, that everytime you write a program into EEPROM with the propeller-tool it overwrites the complete 32k and not only the program-space.
    Yes, k in combination with RAM means 1024.

    So, you should replace the 32k EEPROM with a 64k version.
  • Zap-oZap-o Posts: 452
    edited 2011-01-18 08:16
    yes I understand that every time the propeller is reprogrammed it erases all the EEprom. But you, see the idea is that I program the propeller one time, yet allowing some room in eeprom for data storage while running.

    Thanks for suggesting the 64K version but i am old school and love to make my code tight and small. Fact is the 24LC256 has x4 the memory I need.

    Thanks all.
Sign In or Register to comment.