Hi there,
I'm currently taking a look into the adc_ex4_soc_software_sync example from the C2000 ware 3_04.
What confuses me is that the ADC_setVref function updates the offset trim value for the ADC. It does so by taking the according value from the OTP flash and copy it to the active offset trim register at ADC_BASE_ADDRESS + 0x3B.
What confuses me is that it is done manually while the TRM states the usage of the Device_cal() function. I then figured out that the Device_cal() function actually is used prior to the ADC_setVref function but the results are different. For my paticular device the offset trim value behaves as follows when running the Launchpad in debug mode
Startup
adc offset trim reg = 0 // as expected
Device_init(); // including Device_cal() function
adc offset trim reg =240
ADC_setVref(...)
adc offset trim reg =224
I now wonder which one is the right value and why ADC_setVref is copying the value again. Is there some known issue with Device_cal() Could you tell me the address for the ADCA's offset trim value in the OTP memory? I coudn't find it in the TRM and hence having trouble to verify the addresses used in ADC_setVref.
Any help would be highly appreciated.
Thanks,
Lennart