1 / 19

EEPROM -- 9S12DP256

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

suzuki
Download Presentation

EEPROM -- 9S12DP256

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EEPROM-- 9S12DP256 EETS4K Block Guide

  2. EEPROM • MC12S-DP256 • 4 Kbytes of EEPROM • $0400 - $0FFF • $FEC – FFF used for autostart in CML 12S-DP256

  3. ; 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

  4. ; 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

  5. ; 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

  6. ; 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

More Related