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.

CCS/TMS320F28377D: C2000ware: DeviceSupport - "F2837xD_SysCtrl.c" - "InitSysCtrl"

Part Number: TMS320F28377D
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