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.

How to write to the EEPROM of 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
Assalamo alaykom

Can anyone help me to write to the EEPROM of PIC16F84A .. I don't know anything about it.. and i need help to make the following :

- I make a program that receives IR coded serial signal from a remote control.. The code corresponding to each button consists of 42 bits

- I store each entered into six registers ..

- and then decode code at each button pressed

- then store its decoded value in a register ..

- I take four buttons ( digits ) as a secret code ..

- i.e. I compare them into a stored values in four registers called in my program Code_0, Code_1, Code_2, and Code_3 ...

- if entered code was right .. a LED turned ON to indicate that you PASSED after entering the correct code ..

The problem now is :

I want to make the code variable not fixed by changing it externally .. i.e. I want to store the code to be compared into the EEPROM .. and write to it the new code some way ..

Pleeeeeeese help out .. this project must be delivered the day after tomorrow ..

it is urgent !!! .. i finished every thing and it worked alhamdulillah very good but the secret code is fixed not programmable ....


Thank you very much ..

Salamo alaykom
 

Check out page 14 of the datasheet. It details clearly how to read from and write to the EEPROM.
 

o 3laekom alsalam
to write to eeprom u just must do this steps

1- movlw 00h ;(this is the address of eeprom register so when u store the data u will store it here in this address ok u know that pic16f84a has 64 registers so u can choose any one and here i choose 00h)

2-movwf 09h ,(this is the addres of SFR its name EEADR)

3- movlw 0a ;( 0a is the data which u want to store at 00h address in EEPROM and if ur data in RAM REGISTER register u can use this instruction MOVF ram address,0 after that ur data became in W register)

4- movwf 08 ;(this is the addres of SFR its name is EEDATA)

AFTER THIS STEPS UR DATA IS REDAY TO STORE AT 00H ADRRESS AT EEPROM
and now there is also some other steps this following steps just copy and paste to ur program
ok

5-bsf 03,5 ; (goto bank 1 to do some setting in SFR which belong to eeprom)

6-bsf 08,2 ; (this for write enable)

7-movlw 0x55
8-movwf 09
9-movlw0xaa
10-movwf 09

11- bsf 08,1 ;(when this instruction exeute the writing to EEPROM star u must know that writing to EEPROM take 10 ms

steps7 8 9 10
from micrchip u must write this instruction without think why
there is flag bit in EECON1 register let u know when the writing end
this bit is EEIF (the furth bit 08,4) it become 1 when the writing end

the last note is u r now at bank 1 dont forget that

do u know that i was decide to do this project when i have time
i hope u succed doing it
and i hope this reply helped u
 

Thank you "scorpionss22" ... for your help .. but i want to take your opinion in another points in this project, if you don't mind .. can you contact me to the MSN messenger ? My MSN Messenger contact info is : ahmad_abdulghany@yahoo.com

Please do if you can .. thank you very much ..

Note : i want to inform you that i succeeded in doing this project alhamdulillah ta3ala .. and if you want me to send its documentation to you .. i dont mind ..

Salamo Alaykom ...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top