Author Topic: EEPROM emulation program for LPC8XX.  (Read 2087 times)

0 Members and 1 Guest are viewing this topic.

Offline bequest333Topic starter

  • Contributor
  • Posts: 16
  • Country: jp
EEPROM emulation program for LPC8XX.
« on: June 05, 2014, 06:48:28 am »
Hi,All

I will introduce the EEPROM emulation program LPC8XX.


<Specification of emulation program>

1. Program Size:128Tumb words (256 bytes) It is rewritten r2 and r1 register in running.

2. EEPROM address:15 (0x00 ~ 0x0E)

3. EEPROM data:0x00000000 ~ 0x0FFFFFFF(268435455)

4. Virtual EEPROM space

 Two pages using Flash contiguous area of 16 words (64 bytes),
 In test program, Page0:0x00000D00?0x00000D3F and Page1:0x00000D40?0x00000D7F.

5. Function

 initial_eeprom      Initialize write 0xFFFFFFFF to EEPROM area.
 read_eeprom         r2=EEPROM(r1)
 write_eeprom        EEPROM(r1)=r2

6. Use register(max) 3(r0,r1,r2)

 Specifies the start address of the working buffer register r0,
 16+5 words working buffer (84 bytes) required.



 Writing,
  It does not write reading when the specified value is out of the range,
  to return to rewrite the value of register r1.

     read/write status  ----> EEPROM address is greater than 0x0E        r1 |= 0x80
     write status       ----> EEPROM data is greater than 0x0FFFFFFF       r1 |= 0x40

 Reading,
  The return to rewrite the value of the register r1 when there is no data in the EEPROM specified address,
  0x0FFFFFFF is set in the r2 register at this time.

     read status       ----> There is no data in the specified EEaddress  ?r1 |= 0x20

7. Example of the use of assembler

        ldr       r0,=#XXXXXXXX        @Set the start address of the working buffer to r0
        movs   r1,#Y                        @Set the EEPROM address in r1
        ldr       r2,=#ZZZZZZZZ        @Set the EEPROM data to r2
        bl        write_eeprom           @Subroutine call

8. Data format of internal flash

    EEdata   =< 0x0FFFFFFF    EEdata    (upper 28bits)
    EEaddress < 0xF           EEaddress (lower 4 bits)

    EEPROM Data Format(word): [EEdata31:4|EEaddress3:0]

9. Restriction

 Page1 and Page0 shall be placed in a 128-words boundary.

 O  PAGE0=0x00000E00, PAGE1=0x00000E40
 X  PAGE0=0x00000E40, PAGE1=0x00000E80
 O  PAGE0=0x00000E80, PAGE1=0x00000EC0
 X  PAGE0=0x00000EC0, PAGE1=0x00000F00

 O  PAGE1=0x00000E00, PAGE0=0x00000E40
 X  PAGE1=0x00000E40, PAGE0=0x00000E80
 O  PAGE1=0x00000E80, PAGE0=0x00000EC0
 X  PAGE1=0x00000EC0, PAGE0=0x00000F00

Test circuit


More Information.
https://translate.google.co.jp/translate?sl=ja&tl=en&js=y&prev=_t&hl=ja&ie=UTF-8&u=http%3A%2F%2Fwww3.hp-ez.com%2Fhp%2Fbequest333%2Fpage58&edit-text=

Test Program Download.
ZIP file is possible to import from LPCXpresso as compressed project.
http://hp.vector.co.jp/authors/VA058115/common/lpc810_EEPROM.zip
« Last Edit: June 05, 2014, 06:54:22 am by bequest333 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf