pIC18f452 read and write EEPROM program Listp=18f452
Earmuff headphones are designed for people in the winter. It combines the functions of earmuffs and headphones, allowing people to enjoy music and answer calls without worrying about the cold winter. It frees our hands and protects our ears and is a must-have for the winter.
Earmuff headphones can be customized with different shapes and different colors. They can be cute, simple and cool. They are suitable for children, students, staff and the elderly.
Earmuff headphones have high-quality sound, super bass, medium-tone, high-pitched sound.
With plush headphones, people don't have to worry about cold winter. Earmuff headphones are both beautiful and practical.
Earmuff Headphones,Eye Mask Headphone,Wireless Earmuff Headphones,Bluetooth Earmuff Headphones Shenzhen Linx Technology Co., Ltd. , https://www.linxheadphone.com
#include
;
;----18F452RAMLOCATIONS------
Data_EE_AddrEQU0X000
Data_EE_DataEQU0X001
EEPROM_Bufferequ0x02
;--------VECTORS------------
Org0x00
braSTART
;-------PROGRAM--------------
Org0x20
START
rcallINIT
;
;----TesttheWRITEEEPROMRoutine----
;
clrfData_EE_Addr;setEEPROMstartaddressat0x00
MOVlw'0'; LoadaASCIIcode"0"toW
MOVwfData_EE_Data
EE_Write
rcallIN_DATA_EEW
incfData_EE_Data,F;0x30+N
incfData_EE_Addr,F;PointtonextEEPROMAddress
btfssData_EE_Addr, 5; Write32bytes?
gotoEE_Write
;
;----TesttheREADEEPROMRoutine----
;
clrfFSR0H; SetRAMpointto0x010
MOVlw0x10
MOVwfFSR0L
;
clrfData_EE_Addr
EE_Read
rcallREAD_EEPROM
MOVwfPOSTINC0;moveW-->RAMthenpoint+1
;
incfData_EE_Addr,F;PointtonextEEPROMAddress
btfssData_EE_Addr, 5; Read32bytes?
gotoEE_Read
;
LSTOP
GOTOLSTOP
;
;------INTERNALEEPROMREAD------
;
READ_EEPROM
MOVffData_EE_Addr, EEADR
;
;bcfINTCON, GIE
bcfEECON1, EEPGD
bsfEECON1, RD
MOVfEEDATA, W
;bsfINTCON, GIE
Return
;
;----INTERNALEEPROMWRITE-----
;
IN_DATA_EEW
MOVffData_EE_Addr, EEADR
MOVffData_EE_Data, EEDATA
;
BCFEECON1, EEPGD
BCFEECON1, CFGS; Therearedifferencewithdatasheet
;BCFINTCON, GIE
BSFEECON1, WREN
;
MOVLW0X55
MOVWFEECON2
MOVLW0XAA
MOVWFEECON2
BSFEECON1, WR
;
;BSFINTCON, GIE
LOOP1BTFSSPIR2, EEIF
GOTOLOOP1
;
BCFEECON1, WREN
BCFPIR2, EEIF
RETURN
;---------INITIAL----------------
INIT
BCFPIR2, EEIF
BCFPIE2, EEIE
RETURN
;--------------------------------
END