Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

EEPROM in PIC16f84a ????

Status
Not open for further replies.

ahmad_abdulghany

Advanced Member level 4
Joined
Apr 12, 2005
Messages
1,206
Helped
102
Reputation
206
Reaction score
22
Trophy points
1,318
Location
San Jose, California, USA
Activity points
11,769
pic16f84a eedata

Please anyone tells me how to deal with EEPROM in pic 16f84 ..
also how can i interface an external memory to this pic ..

i need fast and detailed answer please as i will use this in my project ..

thank you very much
 

external eeprom pic16f84a

Which are you development tools? C, ASM ?
In CCS C compiler you have many built in functions to access EEdata and many divers to inteface external memories even though the PIC used doesn't have any I2C nor SPI.
 

Hi,
For internal EEPROM of the PIC look at the datasheet everything is explain for the use of this EEPROM.

For I2C external EEPROM take a look to www.microchipc.com, you will find some code in C to interface this circuit.

CD
 

Hi,

Here is the code in C

#define LAST_VOLUME 10
A = read_EEPROM (LAST_VOLUME);

A;
write_eeprom(LAST_VOLUME,A);
 

hi:

This subrutine codes for assembly programmers. Copy and paste to Mplab ASM file



write_EEPROM
bcf STATUS,5 ;Switch to Bank 0.Because EEADR & EEDATA in Bank0

movlw d'3' ; w <- 3

movwf EEADR ; EEADR <- w
movlw d'20' ; w <- 20
movwf EEDATA ; EEDATA <- w
bsf STATUS,RP0 ; Switch to Bank 1.Because EECON1 & EECON2 in Bank1
bcf INTCON,GIE ; disable all Interrupts
bsf EECON1,WREN ;
movlw 0x55
movwf EECON2
movlw 0xAA
movwf EECON2
bsf EECON1,WR
wait
btfsc EECON1,WR
goto wait


BSF INTCON,7

bcf STATUS,5



return


read_EEPROM

movlw 1h
movwf EEADR
bsf STATUS,RP0
bsf EECON1,RD
bcf STATUS,RP0
movf EEDATA,W
movwf COUNT1

return



BEST R F
Prasad
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top