Other Parts Discussed in Thread: C2000WARE
Tool/software:
hi am using TMS320F28377D microcontroller to access the internal temperature i have used below code but the reading always showing 4095(in decimal) as i want to do polling method instead of interrupt i did not used temperature sensor code in drvierlib
the function that i have used:-
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_ADCA);
ADC_setPrescaler(ADCA_BASE, ADC_CLK_DIV_4_0);
ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN13, 140); // 140 clock cycles @ 200 MHz = 700ns time period to allow temp sensor enough time to acquire data
ADC_setInterruptSOCTrigger(ADCA_BASE, ADC_SOC_NUMBER0, ADC_INT_SOC_TRIGGER_ADCINT1);
ADC_setInterruptSource(ADCA_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER0);
ADC_enableContinuousMode(ADCA_BASE, ADC_INT_NUMBER1);
ADC_enableInterrupt(ADCA_BASE, ADC_INT_NUMBER1);
ADC_clearInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1);
ADC_forceSOC(ADCA_BASE, ADC_SOC_NUMBER0);
ADC_enableConverter(ADCA_BASE);
ASysCtl_enableTemperatureSensor();
DEVICE_DELAY_US(1000);
// Read ADC result
sensorSample = ADC_readResult(ADCARESULT_BASE, ADC_SOC_NUMBER0);
// Convert to temperature (Celsius)
sensorTemp = ADC_getTemperatureC(sensorSample, 3.0f); // assuming 3.0V reference
please let me know if am missing something
regards
J.Muniniteesh


