Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hello everybody,
I found in the C2000ware examples (device_support), in the file "F2837xD_SysCtrl.c" the function "InitSysCtrl".
I don't understand the passage "Check if device is trimmed":
CpuSysRegs.PCLKCR13.bit.ADC_A = 1; CpuSysRegs.PCLKCR13.bit.ADC_B = 1; CpuSysRegs.PCLKCR13.bit.ADC_C = 1; CpuSysRegs.PCLKCR13.bit.ADC_D = 1; // // Check if device is trimmed // if(*((Uint16 *)0x5D1B6) == 0x0000){ // // Device is not trimmed--apply static calibration values // AnalogSubsysRegs.ANAREFTRIMA.all = 31709; AnalogSubsysRegs.ANAREFTRIMB.all = 31709; AnalogSubsysRegs.ANAREFTRIMC.all = 31709; AnalogSubsysRegs.ANAREFTRIMD.all = 31709; } CpuSysRegs.PCLKCR13.bit.ADC_A = 0; CpuSysRegs.PCLKCR13.bit.ADC_B = 0; CpuSysRegs.PCLKCR13.bit.ADC_C = 0; CpuSysRegs.PCLKCR13.bit.ADC_D = 0;
1) Is the adress 0x5D1B6 correct?
The "ANALOG_SUBSYS" base adress is 0x5D180. So the offset is 0x5D1B6-0x5D180 = 0x36 .
I think this is the ADCEVTINTSEL register.
2) Why can I conclude, that the Device is not trimmed, when the ADCOFFTRIM Register is 0x0000 ?
3) Why writing the Value "31709" to the trim registers?
4) Why is this passage not part of the ADC-init ?
Thanks in advance,
Jan