Go to previous topic
Go to next topic
Last Post 11 Sep 2007 04:34 PM by  perlams@gmail.com
Question about the MCF5329 with the I2C
 0 Replies
Author Messages
perlams@gmail.com
New Member
New Member
Posts:


--
11 Sep 2007 04:34 PM
    Hi! I have some troubles to get the SDA and SCL I2C's signals from the MCF5329 I'm using it conected to an I2C eeprom. My Coldfire SDK application board and the Fire Engine are Rev A. i'm using the j38 pin 57 and 58 for the scl and sda respectively.
    The thing is that when the start condition is sended the signal never changes again?? Am i doing something wrong? or is my board?

    I hope someone could help me!!

    This is my inicialization function:

    void vfnI2CInit(void)
    {
    uint8 temp;
    MCF_GPIO_PAR_FECI2C = 0x0F;
    MCF_I2C_I2FDR = MCF_I2C_I2FDR_IC(0x10);
    MCF_I2C_I2CR = 0 | MCF_I2C_I2CR_IEN;
    return;
    }

    And here is the Sending Data function:

    void vfnI2CsendByte(uint8 u8TransmitData, uint8 u8Address, uint8 u8Id)
    {

    MCF_I2C_I2CR |= MCF_I2C_I2CR_MTX;
    MCF_I2C_I2CR |= MCF_I2C_I2CR_MSTA;
    MCF_I2C_I2DR = u8Id;

    while( !(MCF_I2C_I2SR & MCF_I2C_I2SR_IIF ));
    MCF_I2C_I2SR &= ~MCF_I2C_I2SR_IIF; MCF_I2C_I2DR = u8Address;

    while( !(MCF_I2C_I2SR & MCF_I2C_I2SR_IIF ));
    MCF_I2C_I2SR &= ~MCF_I2C_I2SR_IIF;
    MCF_I2C_I2DR = u8TransmitData;

    while( !(MCF_I2C_I2SR & MCF_I2C_I2SR_IIF ));/
    MCF_I2C_I2SR &= ~MCF_I2C_I2SR_IIF;
    MCF_I2C_I2CR &= ~MCF_I2C_I2CR_MSTA;
    return;

    }


    Thnx!


    ---