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.

am335x的时钟分频问题,为什么有个除以二



/*******************************************************************************
*                        API FUNCTION DEFINITIONS
*******************************************************************************/

/**
 * \brief   This API will divide the system clock fed to I2C module between
 *          12 and 100Mhz.It will also configure the I2C bus clock frequency.
 *
 * \param   baseAdd     It is the Memory address of the I2C instance used.
 * \param   sysClk      It is the System clock fed to I2C module.
 * \param   internalClk It is the internal clock used by I2C module.Which is
 *                      obtained by scaling System clock fed to I2C module.
 * \param   outputClk   It is the required I2C bus speed or frequency.
 *
 * \return  None.
 **/
void I2CMasterInitExpClk(unsigned int baseAdd, unsigned int sysClk,
                         unsigned int internalClk, unsigned int outputClk)
{
    unsigned int prescalar;
    unsigned int divider;

    /* Calculate prescalar value */
    prescalar = (sysClk / internalClk) - 1;

    HWREG(baseAdd + I2C_PSC) = prescalar;

    divider = internalClk/outputClk;

    divider = divider / 2;

    HWREG(baseAdd + I2C_SCLL) = divider - 7;

    HWREG(baseAdd + I2C_SCLH) = divider - 5;
}

倒数第三行除以二怎么来的呢??

Fast/Standard mode SCL low time.
I2C master mode only, (FS).
This
8-bit value is used to generate the SCL low time value (tLOW) when
the peripheral is operated in master mode.
tLOW = (SCLL + 7) * ICLK time period, Value after reset is low (all 8
bits).

手册没写要除以二啊