Hi Olivia:
In current LW ADC driver , LWADC_FREQUENCY value should be set in the API _lwadc_init . this value can't be changed with _lwadc_set_attribute.
Please check this API, there is a table made from the datasheet
const static uint32_t adc_max_frq_table[] = {
2500000, /* 2.5 MHz for low power, normal speed, 16b resolution */
5000000, /* 5.0 MHz for low power, normal speed, lower resolution */
5000000, /* 5.0 MHz for low power, high speed, 16b resolution */
8000000, /* 8.0 MHz for low power, high speed, lower resolution */
8000000, /* 8.0 MHz for normal power, normal speed, 16b resolution */
12000000, /* 12.0 MHz for normal power, normal speed, lower resolution */
12000000, /* 12.0 MHz for normal power, high speed, 16b resolution */
18000000, /* 18.0 MHz for normal power, high speed, lower resolution */
};
If you want to use 12M, please change line 127
if (init_ptr->POWER == LWADC_LPC_NORMAL)
adc_max_frq_index |= 0x04;
to
adc_max_frq_index |= 0x05;
I hope it helps
Have a great day,
Daniel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------