Connect with us

EEprom addressing

Discussion in 'Electronic Design' started by Nick, May 12, 2006.

Scroll to continue with content
  1. Nick

    Nick Guest

    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..
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day