EEPROM write and read

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

EEPROM write and read

Postby compass1982 » Sun Apr 29, 2012 4:56 pm

Hi all,

i had wrote a simple code of storing a value into 16F877A EEPROM. the code is as below:

define osc 20
start:
WRITE 0,3

the value of "3" suppose to be written into the EEPROM location of 0000 right? may i know how can i verify the written EEPROM by using pickit2?
(i am using pic basic pro to comple the code, may i know is there any extra header need to be declared?)

thanks~~!
compass1982
Newbie
 
Posts: 9
Joined: Thu Mar 01, 2012 10:13 am

Re: EEPROM write and read

Postby yonghui » Sun Apr 29, 2012 8:34 pm

hi,

pickit can read the memory content of the PIC, just click on read button on pickit2 standalone software.

i was using function call to write and read eeprom of PIC.

normally i check by writing the memory, and reading it back and compare if the read value is same. if same light up the LED, or display the content on LCD.
thanks&regards,
yh
yonghui
Professional
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: EEPROM write and read

Postby compass1982 » Sun Apr 29, 2012 11:44 pm

Hi,
Can u show me an example code on how to do this? U r also using pic basic?
compass1982
Newbie
 
Posts: 9
Joined: Thu Mar 01, 2012 10:13 am

Re: EEPROM write and read

Postby zhenning » Thu May 03, 2012 5:44 pm

Hi,

Dim Write_Value as byte
Dim Read_Value as byte

Write_Value = $10
Read_Value = 0

EWrite 0, [Write_Value] 'Write the contents of 'Write_Value' variable to address 0

Read_Value = ERead 0 'Read the contents from address 0 to Read_Value variable
zhenning
Enthusiast
 
Posts: 351
Joined: Thu Dec 30, 2010 12:32 am


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 0 guests

cron