SDK:simplelink_cc13x0_sdk_3_20_00_23
CC1310F128
adcbuf应用怎么修改参考源,例程测试默认是固定参考源,我修改如下
/*
* =============================== ADCBuf ===============================
*/
#include <ti/drivers/ADCBuf.h>
#include <ti/drivers/adcbuf/ADCBufCC26XX.h>
ADCBufCC26XX_Object adcBufCC26xxObjects[CC1310_LAUNCHXL_ADCBUFCOUNT] = {
{
.inputScalingEnabled = false,
.refSource = ADCBufCC26XX_VDDS_REFERENCE,
}
};
我再CC1310_LAUNCHXL.c中修改了refSource ,好像没起作用,不知道是不是没修改对地方
Kevin Qiu1:
试试在下面当中修改:
const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADCCOUNT] = {{.adcDIO= CC1310_LAUNCHXL_DIO23_ANALOG,.adcCompBInput= ADC_COMPB_IN_AUXIO7,.refSource= ADCCC26XX_FIXED_REFERENCE,.samplingDuration= ADCCC26XX_SAMPLING_DURATION_2P7_US,.inputScalingEnabled = true,.triggerSource= ADCCC26XX_TRIGGER_MANUAL,.returnAdjustedVal= false},{.adcDIO= CC1310_LAUNCHXL_DIO24_ANALOG,.adcCompBInput= ADC_COMPB_IN_AUXIO6,.refSource= ADCCC26XX_FIXED_REFERENCE,.samplingDuration= ADCCC26XX_SAMPLING_DURATION_2P7_US,.inputScalingEnabled = true,.triggerSource= ADCCC26XX_TRIGGER_MANUAL,.returnAdjustedVal= false},
FreePom:
回复 Kevin Qiu1:
这个参数不是用于adcbuf 的,是用于比如例程adcsinglechannel这种模式的,
有没有办法修改adcbuf 的比如例程adcbufcontinuous的ADC的参考源,默认参考源是4.2的,这个方式无法满足我当前的应用
Kevin Qiu1:
回复 FreePom:
你想设置成多少,CC1310参考源有4.3V和VDDS,
看下5.11节:https://www.ti.com.cn/cn/lit/ds/symlink/cc1310.pdf?ts=1595213648539&ref_url=https%253A%252F%252Fwww.ti.com.cn%252Fproduct%252Fcn%252FCC1310
FreePom:
回复 Kevin Qiu1:
我想设置参考源为VDD
FreePom:
回复 Kevin Qiu1:
如上图,我之前说的ADCbuf和普通的ADC,调用的参数是不一样的,你说的那套参数是应用在普通的ADC的
,adcbuf调用的是
ADCBufCC26XX_AdcChannelLutEntry,带有buf的那些
YiKai Chen:
回复 FreePom:
adcbuf例程的話試試我給你的範例程序
FreePom:
回复 YiKai Chen:
好的,非常感谢,应该是这个思路,我先试一下
Kevin Qiu1:
回复 FreePom:
我说的是ADC部分的,ADC用YK Chen说的例程进行修改,API原型在ADCBufCC26XX.h中
typedef struct ADCBufCC26XX_ParamsExtension{ /*! Amount of time the ADC spends sampling the analogue input */ ADCBufCC26XX_Sampling_Duration samplingDuration; /*! Specifies whether the ADC spends a fixed amount of time sampling or the entire time since the last conversion */ ADCBufCC26XX_Sampling_Mode samplingMode; /*! Specifies whether the internal reference of the ADC is sourced from the battery voltage or a fixed internal source */ ADCBufCC26XX_Reference_Source refSource; /*! * Disable input scaling. Input scaling scales an external analogue * signal between 0 and 4.3V to an internal signal of 0 to ~1.4785V. * Since the largest permissible input to any pin is VDDS, the maximum * range of the ADC is effectively less than 3.8V and continues to shrink * as the battery voltage drops. * With input scaling disabled, the external analogue signal is passed * on directly to the internal electronics. Signals larger than ~1.4785V * will damage the device with input scaling disabled. * * | Input scaling status | Maximum permissible ADC input voltage | * |---------------------------|---------------------------------------| * | Enabled | VDDS (Battery voltage level) | * | Disabled | 1.4785V | */ bool inputScalingEnabled; } ADCBufCC26XX_ParamsExtension;