Rev. 1.10
60
October 23, 2020
Rev. 1.10
61
October 23, 2020
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
Writing a Data Page to the EEPROM - polling method
MOV A, 040H ; setup memory pointer low byte MP1L
MOV MP1L, A ; MP1 points to EEC register
MOV A, 01H ; setup memory pointer high byte MP1H
MOV MP1H, A
SET IAR1.4 ; set MODE bit, select page operation mode
MOV A, EEPROM_ADRES ; user defined address
MOV EEA, A
; ~~~~ The data length can be up to 16 bytes (Start) ~~~~
CALL WRITE_BUF
CALL WRITE_BUF
:
:
JMP WRITE_START
; ~~~~ The data length can be up to 16 bytes (End) ~~~~
WRITE_BUF:
MOV A, EEPROM_DATA ; user defined data
MOV EED, A
RET
:
WRITE_START:
CLR EMI
SET IAR1.3 ; set WREN bit, enable write operations
SET IAR1.2 ; start Write Cycle - set WR bit – executed immediately
; after setting WREN bit
SET EMI
BACK:
SZ IAR1.2 ; check for write cycle end
JMP BACK
CLR MP1H