2010-07-26 14:08:39     Using TWI with an at24c512

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-07-26 14:08:39     Using TWI with an at24c512

Adam Rosenberg (UNITED STATES)

Message: 91736   

 

The kernel documentation says that the at24 driver is not compatible with this eeprom because it requires two-byte addresses.  Is there a different driver that supports reading and writing to the at24c512 eeprom?

 

Thanks

Adam

QuoteReplyEditDelete

 

 

2010-07-26 15:38:29     Re: Using TWI with an at24c512

Mike Frysinger (UNITED STATES)

Message: 91739   

 

we dont really keep track of non-ADI parts.  you might want to try asking Atmel.

QuoteReplyEditDelete

 

 

2010-07-27 15:16:14     Re: Using TWI with an at24c512

Adam Rosenberg (UNITED STATES)

Message: 91785   

 

Here is the solution.  You have to shift the I2C address one bit to the left so that it goes into the TWI_MASTER_ADDR Register properly.  Here is what you would see in the board configuration.

 

#if defined(CONFIG_AT24) || defined(CONFIG_AT24_MODULE)

static struct at24_platform_data at24_pdev_data = {

    .byte_len = (524288 / 8),

    .page_size = 128,

    .flags = AT24_FLAG_ADDR16,

};

#endif

 

static struct i2c_board_info __initdata bfin_i2c_board_info[] = {

#if defined(CONFIG_AT24) || defined(CONFIG_AT24_MODULE)

    {

        I2C_BOARD_INFO("24c512", (0xA0 >> 1)),

        .platform_data = (void *)&at24_pdev_data,

    },

#endif

};

 

Thanks,

Adam

Attachments

    Outcomes