Rev. 1.10
58
October 23, 2020
Rev. 1.10
59
October 23, 2020
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
BC66F5652
2.4GHz RF Transceiver A/D Flash MCU
MOV READ_DATA, A
RET
:
PAGE_READ_FINISH:
CLR IAR1 ; disable EEPROM read function
CLR MP1H
Erasing a Data Page to the EEPROM − polling method
MOV A, 040H ; setup memory pointer low byte MP1L
MOV MP1L, A ; MP1L 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
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 Erase_START
; ~~~~ The data length can be up to 16 bytes (End) ~~~~
WRITE_BUF:
MOV A, EEPROM_DATA ; user defined data, erase mode don’t care data value
MOV EED, A
RET
:
Erase_START:
CLR EMI
SET IAR1.6 ; set EREN bit, enable erase operations
SET IAR1.5 ; start Erase Cycle - set ER bit
SET EMI
BACK:
SZ IAR1.5 ; check for erase cycle end
JMP BACK
CLR MP1H
Writing a Data Byte to the EEPROM – polling method
MOV A, 040H ; setup Memory Pointer MP1L
MOV MP1L, A ; MP1L points to EEC register
MOV A, 01H ; setup Memory Pointer MP1H
MOV MP1H, A
CLR IAR1.4 ; clear MODE bit, select byte write mode
MOV A, EEPROM_ADRES ; user defined address
MOV EEA, A
MOV A, EEPROM_DATA ; user defined data
MOV EED, A
CLR EMI
SET IAR1.3 ; set WREN bit, enable write operations
SET IAR1.2 ; start Write Cycle - set WR bit
SET EMI
BACK:
SZ IAR1.2 ; check for write cycle end
JMP BACK
CLR MP1H