Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 17th August 2008, 12:04 PM   (permalink)
Default Saving data to eeprom

Does anyone know how to store data to EEPROM?
I am currenly using PIC18F2620.
apricot_star is offline  
Old 17th August 2008, 12:17 PM   (permalink)
Default

Have a read of this thread.

Mike.
Pommie is offline  
Old 17th August 2008, 12:32 PM   (permalink)
Default

Thank for the reply.
Actually, i know how is the routine like to write and read to eeprom. My problem is that i dunnno how to implement it. I suppose to store the calibration value of light sensor to the eeprom so that my main program will know it when my device is first power up. I just don't understand how is the things work from saving the value and read the value.

Here is the example of what have my friend done:

# define FCIN_ADDR 0x00

result= ReadEeprom(FCIN_ADDR);
result<<=8; // i dun understand why must it shift by 8
tem=ReadEeprom(FCIN_ADDR+1);// why must it increment by1
result+=tem;

Regards

Last edited by apricot_star; 17th August 2008 at 12:38 PM.
apricot_star is offline  
Old 17th August 2008, 01:26 PM   (permalink)
Default

Why not ask your friend?
Mike, K8LH is offline  
Old 17th August 2008, 02:43 PM   (permalink)
Default

Quote:
Originally Posted by apricot_star View Post
Thank for the reply.
Actually, i know how is the routine like to write and read to eeprom. My problem is that i dunnno how to implement it. I suppose to store the calibration value of light sensor to the eeprom so that my main program will know it when my device is first power up. I just don't understand how is the things work from saving the value and read the value.

Here is the example of what have my friend done:

# define FCIN_ADDR 0x00


//Reads the high byte and shifts it 8 to put it in the high byte of results.
result= ReadEeprom(FCIN_ADDR);
result<<=8;
// Read low byte and add it to the result which contains the high byte
tem=ReadEeprom(FCIN_ADDR+1);// why must it increment by1
result+=tem;

Regards
The above code reads a 16 bit value from the EEPROM 8 bits at a time.

Given that you did not understand what the <<= operator was you either need
to learn C or have you friend help you.
3v0 is online now  
Old 18th August 2008, 02:02 AM   (permalink)
Default

Thanks, i got it now =)
apricot_star is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
saving value without eeprom PIC16F72? neelam29 Micro Controllers 1 12th January 2008 08:06 AM
Data EEPROM of PIC questions bananasiong Micro Controllers 35 25th July 2007 10:25 AM
Writing Data to the EEPROM Electrix Micro Controllers 2 31st August 2005 07:39 AM
EEPROM data corruption StupidDum Micro Controllers 0 28th September 2004 05:01 AM
PIC 16f876 data eeprom write SuperBud Micro Controllers 3 22nd October 2003 02:15 AM



All times are GMT. The time now is 08:42 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker