View Single Post
  #27   Spotlight this post!  
Unread 21-01-2004, 00:36
WizardOfAz's Avatar
WizardOfAz WizardOfAz is offline
Lead Mentor
AKA: Bill Bennett
FRC #1011 (CRUSH)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Tucson, AZ
Posts: 101
WizardOfAz will become famous soon enough
Send a message via AIM to WizardOfAz
Re: read/write EEPROM on 18F8520

Quote:
Originally Posted by Astronouth7303
A few questions:
a. What's EEADRH, EEADR, EEDATA, EECON2, and the rest of it?
b. what's the >> in "EEADRH = ((address>>8)&0x03);"?

And yes, I should probably know already.
Those EE names are defined in ifi_picdefs.h.
EEADRH is the high byte of the EEPROM address to be read or written
EEADR is the low byte of the address
EEDATA is the data going in or out of EEPROM
EECON1 and EECON2 are control registers used to do EEPROM operations

>> is shift right, << is shift left
((address>>8)&0x03 says divide address by 256 (that's the shift right 8 part) and zero out all but the lowest two bits (that's the &0x03 part).

Bill