+ All Categories
Home > Documents > EEPROM -- 9S12DP256

EEPROM -- 9S12DP256

Date post: 12-Jan-2016
Category:
Upload: suzuki
View: 117 times
Download: 3 times
Share this document with a friend
Description:
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 - PowerPoint PPT Presentation
19
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell EEPROM -- 9S12DP256 EETS4K Block Guide
Transcript

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

EEPROM-- 9S12DP256

EETS4K

Block Guide

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

EEPROM

• MC12S-DP256– 4 Kbytes of EEPROM– $0400 - $0FFF– $FEC – FFF used for autostart in

CML 12S-DP256

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

; STORE WORD D AT ADDRESS Y AND Y+1EESTD

TST ESTATBPL EED3STD 0,YLDAA #$20 ;program wordSTAA ECMDLDAA #$80STAA ESTAT ;launch the commandLDAA ESTATBITA #$20 ;test PVIOLBNE EED1LDAA #$20STAA ESTAT ;clear PVIOLBRA EED3

EED1 BITA #$10 ;test ACCERRBNE EED2LDAA #$10STAA ESTAT ;clear ACCERRBRA EED3

EED2 LDAA ESTAT ;wait for command to finishBPL EED2

EED3 RTS

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

; ERASE 2 WORDS AT ADDRESS Y to Y+3ERASE

TST ESTATBPL ERS3LDD #0STD 0,Y ;address in sectorLDAA #$40 ;erase sectorSTAA ECMDLDAA #$80STAA ESTAT ;launch the commandLDAA ESTATBITA #$20 ;test PVIOLBNE ERS1LDAA #$20STAA ESTAT ;clear PVIOLBRA ERS3

ERS1 BITA #$10 ;test ACCERRBNE ERS2LDAA #$10STAA ESTAT ;clear ACCERRBRA ERS3

ERS2 LDAA ESTAT ;wait for command to finishBPL ERS2

ERS3 RTS

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

; EE! ( n addr -- )EEST

LDY 2,X+LDD 0,YCPD #$FFFF ;if not FFFFBEQ EES1JSR ERASE ;erase sector

EES1 LDD 2,X+JSR EESTD ;program DRTS

Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell

; ERASE.BULK ( -- )BULKE

TST ESTATBPL ERB3LDD #0STD EESTART ;write anything to EEPROMLDAA #$41 ;erase bulkSTAA ECMDLDAA #$80STAA ESTAT ;launch the commandLDAA ESTATBITA #$20 ;test PVIOLBNE ERB1LDAA #$20STAA ESTAT ;clear PVIOLBRA ERB3

ERB1 BITA #$10 ;test ACCERRBNE ERB2LDAA #$10STAA ESTAT ;clear ACCERRBRA ERB3

ERB2 LDAA ESTAT ;wait for command to finishBPL ERB2

ERB3 RTS


Recommended