This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LM48901 I2C problem, paired with LM3S9D96

Other Parts Discussed in Thread: LM48901

I am seeing an issue on the I2C bus when my project starts up, where the SDA line is always low, so the Stellaris waits forever for the bus to be idle.  There's not much info available in the LM48901 on how/when it initiates I2C master mode, so I'm wondering if there is a master vs master problem here.  My code to initialize the Stellaris I2C is provided here (I've stripped the code I'm using down to bare minimum to test only the I2C)

  ROM_SysCtlClockSet((SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ));


  // Enable necessary peripherals
  //
  ROM_SysCtlPeripheralEnable( SYSCTL_PERIPH_I2C0 );
  ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

  // Configure the pin functions on the GPIO port
  //
  GPIOPinConfigure(   GPIO_PB2_I2C0SCL );
  GPIOPinConfigure(   GPIO_PB3_I2C0SDA );
  ROM_GPIOPinTypeI2C( GPIO_PORTB_BASE, GPIO_PIN_2 | GPIO_PIN_3 );

  // configure the I2C peripheral speed to 100kbs
  //
  ROM_I2CMasterInitExpClk(    I2C0_MASTER_BASE, ROM_SysCtlClockGet(), 0);

  //
  // Turn on all interrupts in the system.
  //
  ROM_IntMasterEnable();

Further information, the only devices on the I2C bus are the Stellaris, the LM48901, and an I2C EEPROM.

Any suggestions would be greatly appreciated.

Ron

  • Ron,

    The definitely sounds like the LM48901's configuration loader is causing the issue.  The LM48901 goes into config loader mode,~10ms after power up.  The device writes an EEPROM address to the I2C bus.  If it receives no ACK after 3 tries, the device goes into I2C slave mode.  If the device receives and ACK, it proceeds to download data from the EEPROM.  What is most likely happening here is the EEPROM on the bus is issuing and ACK, and the LM48901 is trying to down load data from it.  If the EEPROM does not have data, the LM48901's config loader tends to hang the I2C bus. 

    There are two ways around this.  The first is to write to the LM48901 and disable the config loader, set bit 23 of register 0x530 to 0.  You need to do this within the 10ms after power up.

    The other way around this is to change the EEPROM address.  If you have an EEPROM with a selectable address, set it so the address is NOT 1010000.  The EEPROM will not ACK the LM48901, and after 3 tries (~90ms) the LM48901 will release the I2C bus.

    Regards,

    royce

  • Thanks, Royce.  While this does address the issue we are seeing,  this opens up a more interesting question.  Can you please tell me where the master mode operation is described in detail in the LM48901 datasheet and (if any of these exist) user's guide, programmer's guide, design considerations, etc.?

  • Ron,

    I will have Enrique send you a file with details on the config loader.

    Regards,

    royce