Go to previous topic
Go to next topic
Last Post 12 Dec 2013 03:08 PM by  steven.eckhoff
WinCE I2C Baudrates
 0 Replies
Author Messages
steven.eckhoff
Basic Member
Basic Member
Posts:192


--
12 Dec 2013 03:08 PM

    Q: How would I go about adjusting the bit rate of the I2C2 port of the DM3730 SOM-LV running Windows CE? The I2C driver supplied by Logic does not seem to offer alternative bit rates, and I'm finding the default bit rate (seems to be ~ 400 Kbps) incompatible with some of my I2C components.

    A:  See the following code in PLATFORM/LOGIC_ARM_A8/SRC/OAL/OALI2C/i2c_init.c:

    static
    BOOL
    OALI2CSetDeviceBaudrate(
        I2CDevice_t      *pDevice,
        DWORD             baudIndex
        )
    {
        pDevice->currentBaudIndex = baudIndex;
        OUTREG16(&pDevice->pI2CRegs->PSC,  _rgScaleTable[pDevice->currentBaudIndex].psc);
        OUTREG16(&pDevice->pI2CRegs->SCLL, _rgScaleTable[pDevice->currentBaudIndex].scll);
        OUTREG16(&pDevice->pI2CRegs->SCLH, _rgScaleTable[pDevice->currentBaudIndex].sclh);

        return TRUE;
    }



    ---