store string into pic eeprom help!!!

Status
Not open for further replies.

desertkids

Member level 1
Joined
Dec 12, 2007
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Kuala Lumpur, Malaysia
Activity points
1,542
mcc18 eeprom

hi, can tell how i can solve the problem,

1) im have to measure 2 temperature sensor and 1 pressure sensor
2) im can get the particular volt out, temp measure & press measure of each sensor (for exp, volt_T1,TEMP_1,volt_T2,TEMP_2,voit_press,PRESS)
3)now my problem is how i can store all this string in eeprom in pic?should i store it in buffer first?

please help me, if can show me some c code on how to do this, thanks
 

store string in eeprom

What compiler are you using?
Hi-Tech has functions for reading and writing to eeprom, just look in 'pic.h'

I dont use ccs but Im pretty sure that it will support read/write eeprom.

Then just write it and read it, to and from eeprom as an array of values.
 

pic writing string to eeprom

This is the code I use to write values to the EEPROM memory for a 18F2455 and using MCC18

//Next will store status on EEPROM memory
EECON1bits.CFGS = 0; //To be able to perform read/write operations
EECON1bits.EEPGD = 0; //To select EEPROM write operation
EECON1bits.WREN = 1; //Enable writting
EEADR = PacketFromPC.Address; //Address to store
EEDATA = PacketFromPC.Command; //Data to store
EECON2 = 0x55; //Sequence needed to be able to write
EECON2 = 0xAA; //Sequence needed to be able to write
EECON1bits.WR = 1; //Write information
EECON1bits.WREN = 0; //Finish operation
 

write read eeprom ccs

hi, im using ccs compiler. but im stil not very clear on how to store and read the memory. i can write the function to store and read hex code in memory, but not in array/string...please show some c source then i will clear on it..thanks
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…