lpcware

I2C library : DS1631

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by vthinsel on Thu Mar 03 02:02:36 MST 2011
Hello,

I'm porting my I2C library from AVR to LPC176x. The first device I'm porting is the maxim DS1631ib ( http://pdfserv.maxim-ic.com/en/ds/DS1631-DS1731.pdf )

I have an issue as it doesn't get detected. I'm using the Embedded Artists base board and the following configuration/code:


[LIST]
[*]DS1631 pinout
[/LIST]
1=SDA
2=SCL
3=Tout
4=GND
5=A2
6=A1
7=A0
8=Vdd


[LIST]
[*]Connection to LPCXpresso baseboard (using LPC 1769)
[/LIST]

J5-9  : DS1631 pin 2
J5-10 : DS1631 pin 1
J5-1  : DS1631 pin 4,5,6,7
J5-2  : DS1631 pin 8


[LIST]
[*]I2C init code:
[/LIST]
[FONT=Courier New]static void init_i2c(void)
{
    PINSEL_CFG_Type PinCfg;

    /* Initialize I2C2 pin connect */
    PinCfg.Funcnum = 2;
    PinCfg.Pinnum = 10;
    PinCfg.Portnum = 0;
    PINSEL_ConfigPin(&PinCfg);
    PinCfg.Pinnum = 11;
    PINSEL_ConfigPin(&PinCfg);

    // Initialize I2C peripheral
    I2C_Init(LPC_I2C2, 100000);

    /* Enable I2C1 operation */
    I2C_Cmd(LPC_I2C2, ENABLE);
}[/FONT]


The call to[FONT=Courier New] I2C_MasterTransferData(I2CDEV, &txsetup, I2C_TRANSFER_POLLING)[/FONT]fails
Here is the content of the relevant variables upon calling the function

"I2CDEV" = 0x400a0000   

txsetup    {...}   
    sl_addr7bit    144   
    tx_data    0x10007f7f   
    tx_length    1   
    tx_count    0   
    rx_data    0x00000000   
    rx_length    0   
    rx_count    0   
    retransmissions_max    3   
    retransmissions_count    4   
    status    544   
    callback    0x00000000

Where should I look now ?

Thanks.

Outcomes