View Single Post
  #1   Spotlight this post!  
Unread 16-03-2004, 16:35
DKolberg DKolberg is offline
Mentor Iron Giants
AKA: David Kolberg
FRC #5069 (Iron Giants)
Team Role: Mentor
 
Join Date: May 2002
Rookie Year: 2000
Location: South Bend
Posts: 44
DKolberg has a spectacular aura aboutDKolberg has a spectacular aura about
Question Problem with reading and writing EEPROM

I have copied the code found elsewhere into eeprom.h and eeprom.c and all I can get in the read is 0xFF. I have tried manual reads of the eeprom using the raw code

// Load address into address register
EEADRH = 0;
EEADR = 1

//Configuration as per manual
EECON1bits.EEPGD = 0;
EECON1bits.CFGS = 0;
EECON1bits.RD = 1;

printf("eeprom read address High %d, Low %d, Value %d\n",
(int) EEADRH, (int) EEADR, (int) EEDATA);

I have a similar printf statement in the write eeprom routine and all I get is 0xFF for data reads.

I will try a direct write in the initialize area and then modify the code to do a direct read in the initialize area to see if that works.

Any other suggestions?

Dave Kolberg