Eeprom 9s12dp256
Download
1 / 19

EEPROM -- 9S12DP256 - PowerPoint PPT Presentation


  • 157 Views
  • Uploaded on

EEPROM -- 9S12DP256. EETS4K Block Guide. EEPROM. MC12S-DP256 4 Kbytes of EEPROM $0400 - $0FFF $FEC – FFF used for autostart in CML 12S-DP256. ; STORE WORD D AT ADDRESS Y AND Y+1 EESTD TST ESTAT BPL EED3 STD 0,Y LDAA #$20 ;program word STAA ECMD

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' EEPROM -- 9S12DP256' - suzuki


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Eeprom 9s12dp256

EEPROM-- 9S12DP256

EETS4K

Block Guide


Eeprom
EEPROM

  • MC12S-DP256

    • 4 Kbytes of EEPROM

    • $0400 - $0FFF

    • $FEC – FFF used for autostart in CML 12S-DP256


; STORE WORD D AT ADDRESS Y AND Y+1

EESTD

TST ESTAT

BPL EED3

STD 0,Y

LDAA #$20 ;program word

STAA ECMD

LDAA #$80

STAA ESTAT ;launch the command

LDAA ESTAT

BITA #$20 ;test PVIOL

BNE EED1

LDAA #$20

STAA ESTAT ;clear PVIOL

BRA EED3

EED1 BITA #$10 ;test ACCERR

BNE EED2

LDAA #$10

STAA ESTAT ;clear ACCERR

BRA EED3

EED2 LDAA ESTAT ;wait for command to finish

BPL EED2

EED3 RTS


; ERASE 2 WORDS AT ADDRESS Y to Y+3

ERASE

TST ESTAT

BPL ERS3

LDD #0

STD 0,Y ;address in sector

LDAA #$40 ;erase sector

STAA ECMD

LDAA #$80

STAA ESTAT ;launch the command

LDAA ESTAT

BITA #$20 ;test PVIOL

BNE ERS1

LDAA #$20

STAA ESTAT ;clear PVIOL

BRA ERS3

ERS1 BITA #$10 ;test ACCERR

BNE ERS2

LDAA #$10

STAA ESTAT ;clear ACCERR

BRA ERS3

ERS2 LDAA ESTAT ;wait for command to finish

BPL ERS2

ERS3 RTS


; EE! ( n addr -- )

EEST

LDY 2,X+

LDD 0,Y

CPD #$FFFF ;if not FFFF

BEQ EES1

JSR ERASE ;erase sector

EES1 LDD 2,X+

JSR EESTD ;program D

RTS


; ERASE.BULK ( -- )

BULKE

TST ESTAT

BPL ERB3

LDD #0

STD EESTART ;write anything to EEPROM

LDAA #$41 ;erase bulk

STAA ECMD

LDAA #$80

STAA ESTAT ;launch the command

LDAA ESTAT

BITA #$20 ;test PVIOL

BNE ERB1

LDAA #$20

STAA ESTAT ;clear PVIOL

BRA ERB3

ERB1 BITA #$10 ;test ACCERR

BNE ERB2

LDAA #$10

STAA ESTAT ;clear ACCERR

BRA ERB3

ERB2 LDAA ESTAT ;wait for command to finish

BPL ERB2

ERB3 RTS