DS1994 memory response problem


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Default ERROR response! from DS1994 device

    Hallo All,im working with BeckSC12 µC to communicate with DS1994(EEPROM) through DS2484(1 wire -I2C interface device).im also using beck I2C API!
    i wrote 00 11 to the EEPROM scratchpad but when reading back,i get aa and a seiries of FF!!!!!!!!!!!!!!what could be the problem!
    thanks.

    SEE CODE BELOW!!!!!!!!!!!!!!



    void WMatchEEPROM() //matchrom and write to eeprom page
    {

    uchar bufs0[2];
    uchar bufs1[2];
    uchar bufs2[2];
    uchar bufs3[2];
    uchar bufs4[2];
    uchar bufs5[2];
    uchar bufs6[2];
    uchar bufs7[2];
    uchar bufs8[2];
    uchar bufs9[2];
    uchar bufs10[2];
    uchar bufs11[2];
    uchar bufs12[2];
    uchar bufs13[2];
    onewreset1(); // 1 wire reset and reading the status register

    bufs0[0]=0xA5; // 1 wire write byte
    bufs0[1]=0x55; //match rom command
    I2C_transmit_block(0x30,bufs0,2);
    //I2C_release();
    bufs1[0]=0xA5;
    bufs1[1]=0x93; //MSB for eeprom address(start)7
    I2C_transmit_block(0x30,bufs1,2);
    //I2C_release();
    bufs2[0]=0xA5;
    bufs2[1]=0x00;// 6
    I2C_transmit_block(0x30,bufs2,2);
    //I2C_release();
    bufs3[0]=0xA5;
    bufs3[1]=0x00;// 5
    I2C_transmit_block(0x30,bufs3,2);
    //I2C_release();
    bufs4[0]=0xA5;
    bufs4[1]=0x00;// 4
    I2C_transmit_block(0x30,bufs4,2);
    //I2C_release();
    bufs5[0]=0xA5;
    bufs5[1]=0x14;// 3
    I2C_transmit_block(0x30,bufs5,2);
    //I2C_release();
    bufs6[0]=0xA5;
    bufs6[1]=0xA5;// 2
    I2C_transmit_block(0x30,bufs6,2);
    //I2C_release();
    bufs7[0]=0xA5;
    bufs7[1]=0x15;// 1
    I2C_transmit_block(0x30,bufs7,2);
    //I2C_release();
    bufs8[0]=0xA5;
    bufs8[1]=0x04;//0 LSB, adress end
    I2C_transmit_block(0x30,bufs8,2);
    I2C_release();
    bufs9[0]=0xA5;
    bufs9[1]=0x0F;//write scratchpad
    I2C_transmit_block(0x30,bufs9,2);
    //I2C_release();
    bufs10[0]=0xA5;
    bufs10[1]=0x00;//Msb of page1 address
    I2C_transmit_block(0x30,bufs10,2);
    //I2C_release();
    bufs11[0]=0xA5;
    bufs11[1]=0x26;//Lsb of page 1 address
    I2C_transmit_block(0x30,bufs11,2);
    //I2C_release();
    bufs12[0]=0xA5;
    bufs12[1]=0x11;// data to page 1 address
    I2C_transmit_block(0x30,bufs12,2);
    bufs13[0]=0xA5;
    bufs13[1]=0x22;// data to page 1 address
    I2C_transmit_block(0x30,bufs13,2);
    ReadStatusReg(); //status reg infomation
    I2C_release();
    }

    uchar RMatchEEPROM() //read eeprom page data
    {

    uchar bufs0[2];
    uchar bufs1[2];
    uchar bufs2[2];
    uchar bufs3[2];
    uchar bufs4[2];
    uchar bufs5[2];
    uchar bufs6[2];
    uchar bufs7[2];
    uchar bufs8[2];
    uchar bufs9[2];
    uchar bufx[2];
    uchar y,*ptry;
    uchar bufs[2];
    int i;
    onewreset1(); // 1 wire reset and reading the status register

    bufs0[0]=0xA5; // 1 wire write byte
    bufs0[1]=0x55; //match rom command
    I2C_transmit_block(0x30,bufs0,2);
    //I2C_release();
    bufs1[0]=0xA5;
    bufs1[1]=0x93; //MSB for eeprom address(start)7
    I2C_transmit_block(0x30,bufs1,2);
    //I2C_release();
    bufs2[0]=0xA5;
    bufs2[1]=0x00;// 6
    I2C_transmit_block(0x30,bufs2,2);
    //I2C_release();
    bufs3[0]=0xA5;
    bufs3[1]=0x00;// 5
    I2C_transmit_block(0x30,bufs3,2);
    //I2C_release();
    bufs4[0]=0xA5;
    bufs4[1]=0x00;// 4
    I2C_transmit_block(0x30,bufs4,2);
    //I2C_release();
    bufs5[0]=0xA5;
    bufs5[1]=0x14;// 3
    I2C_transmit_block(0x30,bufs5,2);
    //I2C_release();
    bufs6[0]=0xA5;
    bufs6[1]=0xA5;// 2
    I2C_transmit_block(0x30,bufs6,2);
    //I2C_release();
    bufs7[0]=0xA5;
    bufs7[1]=0x15;// 1
    I2C_transmit_block(0x30,bufs7,2);
    //I2C_release();
    bufs8[0]=0xA5;
    bufs8[1]=0x04;//0 LSB, adress end
    I2C_transmit_block(0x30,bufs8,2);
    //I2C_release();
    bufs9[0]=0xA5;// 1 wire byte
    bufs9[1]=0xAA;//read scratchpad
    I2C_transmit_block(0x30,bufs9,2);

    for(i=0;i<32;i++)
    {
    I2C_transmit_char(0x30,0x96); //1 wire readbyte
    I2C_release();
    //I2C_release();
    //bufs[0]=0x96;
    //bufs[1]=0x00;//Msb of page2
    //I2C_transmit_block(0x30,bufs,2);
    //I2C_release();
    // bufs[0]=0x96;
    // bufs[1]=0x00;//Lsb of page 2
    //I2C_transmit_block(0x30,bufs,2);
    ReadStatusReg(); //status reg infomation
    //I2C_release();
    bufx[0]=0xE1;//set readpointer
    bufx[1]=0xE1;//to data register
    I2C_transmit_block(0x30,bufx,2);
    I2C_receive_block(0x30,&y,1);
    printf("\n show reg data here!%02x\n",y);
    I2C_release();
    }
    return y;
    }

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by chika View Post
    Hallo All,im working with BeckSC12 µC to communicate with DS1994(EEPROM) through DS2484(1 wire -I2C interface device).im also using beck I2C API!
    i wrote 00 11 to the EEPROM scratchpad but when reading back,i get aa and a seiries of FF!!!!!!!!!!!!!!what could be the problem!
    thanks.
    Is that Microchip C you are using?

Similar Threads

  1. Memory Problem
    By morphyn in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th February 2009, 21:59
  2. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 00:22
  3. Replies: 4
    Last Post: - 2nd March 2007, 06:12
  4. 18F out of memory problem
    By tom in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd January 2007, 06:58
  5. Use internal program memory like DATA memory
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th December 2006, 18:38

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts