English
Language : 

SAB88C166 Datasheet, PDF (20/58 Pages) Siemens Semiconductor Group – 16-Bit CMOS Single-Chip Microcontrollers with/without oscillator prescaler with 32 KByte Flash EPROM
SAB 88C166(W)
q Enter writing mode via unlock sequence (prerequisite for any programming or erase
operation).
MOV
MOV
CALL
FCR, Rwn
[Rwn], Rwn
cc_UC, WAIT_10
; Dummy write to the FCR
; Both operands use the same GPR
; Delay for 10 µs
q Program the FCR register with a value that selects the desired operating mode. Note that this
does not yet start the programming operation itself.
MOV
R15, #1000 0000 1010 0001B
; #xxxx xxxx xxxx xxx1: FWE=’1’:
; #xxxx xxxx xxxx xx0x: FEE=’0’:
; #xxxx xxxx x01x xxxx: CKCTL=’01’:
; #xxxx xxxx 1xxx xxxx: WDWW=’1’:
; #1xxx xxxx xxxx xxxx: FWMSET=’1’:
Enable Flash write operations
Select programming mode
100 µs programming pulse (fCPU = 20 MHz)
Select 32-bit programming mode
Stay in writing mode
MOV DPP1:pof FCR, R15
; Write Value to the FCR using 16-bit access
q Initialize pointers and counter for the first transfer of the programming algorithm.
The source data block is accessed via the pointer SRC_PTR, initialized with SRC_START. All
read operations via SRC_PTR use DPP2, which selects data page 1 in this example.
The Flash memory must be accessed indirectly and uses the pointer FLASH_PTR, initialized
with FLASH_START.
The counter DWCOUNT defines the number of doublewords to be programmed.
q Test for correct VPP margin at pin VPP/EBC1 before a programming operation is started. If bit
VPPREV reads ‘1’, the programming voltage is correct and the algorithm can be continued.
Otherwise, the programming routine could wait in Flash writing mode until VPP reaches its correct
value and resume programming then, or it could exit writing mode.
MOV R15, DPP1:pof FCR
JB
R15.4, Vpp_OK1
…
Vpp_OK1:
; Read FCR contents using 16-bit access
; Test VPP via bit VPPREV (= FCR.4)
; VPPREV=’0’: Exit programming procedure
; VPPREV=’1’: Test Okay! Continue
Semiconductor Group
19