TI中文支持网
TI专业的中文技术问题搜集分享网站

CC2530 ADC 采样电平问题

专家好,

平台:CC2530+Z-STACK2.5.1a,

问题描述:新项目需使用多路ADC,

目前发现P0_4采样端电压在非采样期间其电压会被拉低。采样期间电平又恢复正常。采样电路及波形图如下。

问:如何解释?是协议栈里面配置的问题吗?

端口配置如下:

//将P0.0-P0.5配置为模拟IO口

  P0DIR&=~0X3F;

  P0SEL|=0X3F;  //外部设备功能

  APCFG = 0x3F;  //模拟IO使能

ADC用的协议栈API.

另,想屏蔽串口,是否直接定义 HAL_UART FLASE即可?

项目急,盼回复!

Alvin Chen:

1.
preprocessor set option :HAL_ADC=TRUE

CC2530/CC2541 ADC Howto in TI Z-Stack/BLE Stack
It is always a mystery to beginner to use ADC on CC2530/CC2541. Here, I post how to use TI Z-Stack/BLE Stack API to read ADC value on CC2530/CC2541. I hope this post can help anyone who struggles on CC2530/CC2541 ADC usage. In the followings, I show how to use P0_2 as ADC input, HAL_ADC_REF_125V as reference voltage, and HAL_ADC_RESOLUTION_10, HAL_ADC_RESOLUTION_12, HAL_ADC_RESOLUTION_14 as ADC resolution respectively.

1.Read ADC value from P0_2 using HAL_ADC_REF_125V as reference voltage and HAL_ADC_RESOLUTION_10 as ADC resolution.
uint16 adc_ain2=0;HalAdcSetReference(HAL_ADC_REF_125V);adc_ain2=HalAdcRead(HAL_ADC_CHN_AIN2,HAL_ADC_RESOLUTION_10);

The max measurable voltage of P0_2 is 1.15 because I am using HAL_ADC_REF_125V as reference voltage here. If the input voltage is larger than 1.15V, the ADC reading adc_ain2 will be always 511. If I connect P0_2 to 0.5V, I will have ADC reading adc_ain2=223. Then, we can convert the reading 223 to measured voltage using the following equation.
measured voltage = 1.15×223/511=0.501…

2. If I changeHAL_ADC_RESOLUTION_12 (the max reading is 2047) as ADC resolution and connect P0_2 to 0.5V, I will have ADC reading adc_ain2=886. Then, we can convert the reading 889 to measured voltage using the following equation.
measured voltage = 1.15×889/2047=0.499…

3. If I changeHAL_ADC_RESOLUTION_14 (the max reading is 8191) as ADC resolution and connect P0_2 to 0.5V, I will have ADC reading adc_ain2=3550. Then, we can convert the reading 3550 to measured voltage using the following equation.
measured voltage = 1.15×3550/8191=0.498…
Thanks for YK blog.
sunmaysky.blogspot.com/…/cc2530-adc-howto-in-ti-z-stack.html
2.
preprocessor set option :HAL_UART =0

da qin zheng sheng:

一共采集了几路模拟信号?其它通道正常?另外测试一块板子试试。

赞(0)
未经允许不得转载:TI中文支持网 » CC2530 ADC 采样电平问题
分享到: 更多 (0)