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.

CC1310: SCS的ADC采样和主程序中的ADC采样冲突问题

Part Number: CC1310

CC1310 5*5mm。之前采用SCS中设置DIO13定时采样NTC的电压值来获取温度值,功能正常没有问题。现在主程序中增加个在发送前加测ADC采样外部的电压值(分压电阻)DIO12。开始运行时,SCS的温度值时对的;等主程序中运行发送前采样完电压值后,发现SCS再采样的温度值就不对了,采样的电压值是没问题的。怀疑时ADC的设置和SCS冲突了,请问检查那些地方,可能是哪的问题。

*****************************************************

scs initialization:

fwDelayUs(200, FW_DELAY_RANGE_1_MS);

// 选择ADC输入

adcSelectGpioInput(AUXIO_A_SENSOR_OUTPUT);

evhSetupTimer1Trigger(0, cfg.TimeSet, 8);

********************************************************

*******************************************************

scs event handler a:

evhCancelTrigger(0);

gpioClearOutput(AUXIO_O_SENSOR_GND);

// 使能ADC( VDDS为参考)

adcEnableSync(ADC_REF_VDDS_REL, ADC_SAMPLE_TIME_2P7_US, ADC_TRIGGER_MANUAL);

// 传感器采样

U16 adcValue;

adcGenManualTrigger(); // 单次触发

adcReadFifo(adcValue); // 读取ADC值

output.adcValue = adcValue;

adcDisable();

**************************************************

主程序

**************************************************

void mAdc_init(void)
{
ADC_Params params;
ADC_init();
ADC_Params_init(&params);
Volt_adc = ADC_open(CC1310_LAUNCHXL_ADC5, &params);//CC1310_LAUNCHXL_ADC5 ok
}

static void SendPacket(void)
{
int_fast16_t res;
ADC_Params params;
res = ADC_convert(Volt_adc, &adcValue0);
if (res == ADC_STATUS_SUCCESS)
{
RadioTx.TxPacket.payload[1]=(adcValue0>>8)&0xff;
RadioTx.TxPacket.payload[2]=(adcValue0>>0)&0xff;
}
 ADC_close(Volt_adc);

.......

}