Tool/software: Code Composer Studio
Hello,
I have recently got a TMS320F28337s launchpad, and tried to understand the basic example which comes with the board. When sampling from ADC, following code is used:
int16_t sampleADC(void)
{
int16_t temp;
//Force start of conversion on SOC0
AdcaRegs.ADCSOCFRC1.all = 0x03;
//Wait for end of conversion.
while(AdcaRegs.ADCINTFLG.bit.ADCINT1 == 0){} //Wait for ADCINT1
AdcaRegs.ADCINTFLGCLR.bit.ADCINT1 = 1; //Clear ADCINT1
//Get temp sensor sample result from SOC0
temp = AdcaResultRegs.ADCRESULT1;
//Return the raw temperature because the devices don't have slope/offset values
return(temp);
First the example wants to force start the conversion on SOC0, but they write 0x03, which should be SOC3 as i understand it from datasheet(im new to digital/programming). Second, they want the temp from ADCRESULT1 which looks at SOC1 and not SOC0 as they state. Can someone please explain what i'm missing?
PS: if any of you have knowledge about digital control loop design, and want to explain it to me over skype, i will be forever happy and thankful.
Best regard