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.
The function validation of the input parameter ui32ClockDiv appears to be incorrect. The function prototype is:
ADCClockConfigSet(uint32_t ui32Base, uint32_t ui32Config,
uint32_t ui32ClockDiv)
The function sets the clock divisor (a 6 bit value) in ADC_O_CC to (ui32Config - 1) << ADC_CC_CLKDIV_S, which is correct, since the field occurs in bits (9-4) of the register. However, the function validates the input parameter using:
ASSERT(((ui32ClockDiv - 1) & ~ADC_CC_CLKDIV_M) == 0);
where ADC_CC_CLKDIV_M is 0x3f0 (that is, the shifted mask value). This test is not correct; certain valid input divisor values (17, 33) will be rejected, while other invalid values may be accepted. The test should be:
ASSERT((((ui32ClockDiv - 1) << ADC_CC_CLKDIV_S) & ~ADC_CC_CLKDIV_M) == 0);
Hello Tim,
Agreed. However for the values of the divider is based on VCO/16 or VCO/32.
For the VCO's of 480 and 320MHz, the values will work out to be fine and thus it will make through the ASSERT.
I will still go ahead and file a bug on the software for correction.
Regards
Amit