EEprom addressing
- From: "Nick" <aniket_gokhale@xxxxxxxxx>
- Date: 11 May 2006 23:46:27 -0700
Hi Guys,
I am unable to write a code for data read/write from EEprom. Here's the
functio below:
signed char eeprom_read
unsigned char eeprom_read
( unsigned int address----- // 9-bit address to read (0x000 -
0x1FF) ) ------????
{
// wait for previous operation to complete
while (meeprombusy);
// eeprom now busy
meeprombusy = 1;
// store bit 8 of address
// byte operation, clear interrupt flag
DEECON = (address >> 8) & 0x01;
// store bits 0-7 of address
DEEADR = address & 0xFF;
// if not using interrupt then poll for end of operation
if (!EA || !EIEE)
{
// wait for operation to complete
while (!(DEECON & 0x80));
// eeprom no longer busy
meeprombusy = 0;
// return value
return DEEDAT;
}
I have picked this code form Code architect for LPC932. I have tried
writing address -----
Keil always a syntax error. And i want to know how can i write 6 bytes
and read them when required...
Please help..
With Regards..
Nick
.
- Prev by Date: EZ connectors
- Next by Date: Gates in an old MOS chip
- Previous by thread: EZ connectors
- Next by thread: Gates in an old MOS chip
- Index(es):
Relevant Pages
|