Part Number:CC1310
4*4 的芯片
我把5,6,7口设置成一般io,8,9设置成ad,这样配置的:
const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADCCOUNT] = {
// {
// .adcDIO = CC1310_LAUNCHXL_DIO5_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO4,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
// {
// .adcDIO = CC1310_LAUNCHXL_DIO6_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO3,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
// {
// .adcDIO = CC1310_LAUNCHXL_DIO7_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO2,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
{
.adcDIO = CC1310_LAUNCHXL_DIO8_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO1,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = CC1310_LAUNCHXL_DIO9_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO0,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
// {
// .adcDIO = CC1310_LAUNCHXL_DIO28_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO2,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
// {
// .adcDIO = CC1310_LAUNCHXL_DIO29_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO1,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
// {
// .adcDIO = CC1310_LAUNCHXL_DIO30_ANALOG,
// .adcCompBInput = ADC_COMPB_IN_AUXIO0,
// .refSource = ADCCC26XX_FIXED_REFERENCE,
// .samplingDuration = ADCCC26XX_SAMPLING_DURATION_10P9_MS,
// .inputScalingEnabled = true,
// .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
// .returnAdjustedVal = false
// },
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_DCOUPL,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_VSS,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_VDDS,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
}
};
typedef enum CC1310_LAUNCHXL_ADCBuf0ChannelName {
// CC1310_LAUNCHXL_ADCBUF0CHANNEL0 = 0,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL1,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL2,
CC1310_LAUNCHXL_ADCBUF0CHANNEL3,
CC1310_LAUNCHXL_ADCBUF0CHANNEL4,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL5,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL6,
// CC1310_LAUNCHXL_ADCBUF0CHANNEL7,
CC1310_LAUNCHXL_ADCBUF0CHANNELVDDS,
CC1310_LAUNCHXL_ADCBUF0CHANNELDCOUPL,
CC1310_LAUNCHXL_ADCBUF0CHANNELVSS,
CC1310_LAUNCHXL_ADCBUF0CHANNELCOUNT
} CC1310_LAUNCHXL_ADCBuf0ChannelName;
/*!
* @def CC1310_LAUNCHXL_ADCName
* @brief Enum of ADCs
*/
typedef enum CC1310_LAUNCHXL_ADCName {
// CC1310_LAUNCHXL_ADC0 = 0,
// CC1310_LAUNCHXL_ADC1,
// CC1310_LAUNCHXL_ADC2,
CC1310_LAUNCHXL_ADC3,
CC1310_LAUNCHXL_ADC4,
// CC1310_LAUNCHXL_ADC5,
// CC1310_LAUNCHXL_ADC6,
// CC1310_LAUNCHXL_ADC7,
CC1310_LAUNCHXL_ADCDCOUPL,
CC1310_LAUNCHXL_ADCVSS,
CC1310_LAUNCHXL_ADCVDDS,
CC1310_LAUNCHXL_ADCCOUNT
} CC1310_LAUNCHXL_ADCName;
调用ADC_open(Board_ADC3, ¶ms);或者ADC_open(Board_ADC0, ¶ms);结果都不对。
请问可以这样用吗?
Nick Sun:
您好,
感谢您的对TI产品的关注!为更加有效地解决您的问题,我需要多一些时间查看这个问题,稍后会为您解答。
,
Nick Sun:
您好,
这边有一些问题想要问您:
与哪些值不同的 ADC 输入不同?两个引脚是否连接到同一个源?您是使用的什么 SDK 版本?
,
anne:
你好:
simplelink_cc13x0_sdk_4_20_01_03
我现在的现象是只有 把信号接到dio8 ,AD_open(Board_ADC0, ¶ms);才能得到正确结果。
把信号接到其他ad口,相应设置好后,也不行,都是同一个信号
另外我的问题就是 ,这5个ad口不用同时定义成ad吧?为什么只有把他们都定义成ad口,信号接到dio8,采用通道0,这三个条件同时成立,才能得到正确结果。
,
Nick Sun:
您好,
我们工程师不确定是否理解您的问题。您是需要2个(pin8和pin9),还是5个模拟输入?
您是否能分享您这样操作试图实现的目标是什么?
,
anne:
我现在用一个模拟信号放在不同的通道做转化实验
当把信号放到dio8时
adcBuf = ADCBuf_open(CC1310_LAUNCHXL_ADCBUF0CHANNEL0,&adcBufParams);
/* Configure the conversion struct */continuousConversion.arg = NULL;continuousConversion.adcChannel = 1;continuousConversion.sampleBuffer = sampleBufferOne;continuousConversion.sampleBufferTwo = sampleBufferTwo;continuousConversion.samplesRequestedCount = ADCBUFFERSIZE;
如上设置ad,可以得到正确结果;
当把信号放到dio9时,
adcBuf = ADCBuf_open(CC1310_LAUNCHXL_ADCBUF0CHANNEL0,&adcBufParams);
/* Configure the conversion struct */continuousConversion.arg = NULL;continuousConversion.adcChannel = 0;continuousConversion.sampleBuffer = sampleBufferOne;continuousConversion.sampleBufferTwo = sampleBufferTwo;continuousConversion.samplesRequestedCount = ADCBUFFERSIZE;
continuousConversion.adcChannel 设置成0,1,2,3,4 均不能得到正确结果。
把信号放到dio5,dio7时,也是如此,无论通道设置成0-4的那一路,转换结果都不正确
不知道我表达清楚没有。
转化程序我用的是sdk 01-03 里面的例程,连续转换。我用ti的1350仿真板(7*7把这个模拟信号放到任何一个通道,都能转化正确。我自己做的板子,只有放到dio8才能正确。
,
Nick Sun:
您好,
收到您的跟进,帮您同步工程师,有回复即刻联系您。
,
Nick Sun:
您好,
从布局来看,DIO9 (针脚26)是否为常闭?(From the layout it looks like DIO9 (pin 26) is NC? )
,
anne:
对,dio6,dio9都是悬空的,没有接
,
Nick Sun:
您好,
收到您的跟进,帮您同步工程师,有回复即刻联系您。
,
Nick Sun:
您好,
我们认为需要更多 IO 配置,因为7×7 IO 与4×4封装的 IO 不同。
查看该文档:https://dev.ti.com/tirex/explore/content/simplelink_cc13x0_sdk_4_20_02_07/docs/tidrivers/doxygen/html/_a_d_c_buf_c_c26_x_x_8h.html
您似乎必须按如下方式配置 ADC IO:
DIO8应为:
{ .adcDIO = CC1310_LAUNCHXL_DIO8_ANALOG,//Should be = to IOID_8 .adcCompBInput = ADC_COMPB_IN_AUXIO4, .refSource = ADCCC26XX_FIXED_REFERENCE, .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US, .inputScalingEnabled = true, .triggerSource = ADCCC26XX_TRIGGER_MANUAL, .returnAdjustedVal = false },DIO9应为:
{ .adcDIO = CC1310_LAUNCHXL_DIO9_ANALOG,//Should be = to IOID_9 .adcCompBInput = ADC_COMPB_IN_AUXIO3, .refSource = ADCCC26XX_FIXED_REFERENCE, .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US, .inputScalingEnabled = true, .triggerSource = ADCCC26XX_TRIGGER_MANUAL, .returnAdjustedVal = false },您可以操作一下,然后和我们说一下结果如何。希望能有所帮助。
,
anne:
您好,按您说的设置,终于可以正常采样了。多谢!
,
Nick Sun:
您好,
很高兴您的问题被解决。您可以点击已解决按钮表示问题已被解决。