在开始讲解的前,我们不生产水,我们只是大自然的搬运工。开始搬手册(nRF51 Series Reference Manual Version 3.0)上的资料

 

AIN0----------------P0.27

AIN1----------------P0.26

AIN2----------------P0.01

AIN3----------------P0.02

AIN4----------------P0.03

AIN5----------------P0.04

AIN6----------------P0.05

AIN7----------------P0.06

 

Set input voltage range
It is very important you configure the ADC so the input voltage range and the ADC voltage range is matching.If the input voltage range is lower than the ADC voltage range, the resolution will not be fully utilized.If the input voltage range is higher than the ADC voltage range, all values above the maximum ADC voltage range will be limited to the maximum value, also called the saturation point.Input voltage range and saturation point depends on the configured ADC reference voltage and the chosen prescaling. If the 1.2 V VBG internal reference voltage is used, the ADC range will be 0-1.2 V with a saturation point of 1.2 V. This means that your AIN signal with 1/1 prescaling should be in the range 0-1.2V in order to obtain proper conversion. Input above 1.2 V will be converted to the maximum ADC value.However, if you use, for example, 1/3 prescaling for your AIN input the input is scaled down to 1/3. The effect
is that your AIN voltage range is 0 - 3.6 V because the 3.6 V input voltage is scaled down to 3.6 / 3 = 1.2V. Table 1 shows examples of reference voltage and prescaling settings and the corresponding saturation points for ADC AIN input.

Saturation point examples

 

 

Voltage divider
There are two rules to follow to find the maximum input voltage allowed on the AIN pins:
1. The ADC should not be exposed to higher voltage than 2.4 V on an AIN pin after prescaling: Input voltage x prescaling = max. 2.4 V.

2. A GPIO pin must not be exposed to higher voltage than VDD + 0.3 V, according to the Absolute maximum ratings from the nRF51x22 Product Specification.

For example, when using 2/3 prescaling, you can expose 2.4 V / (2/3) = 3.6 V to an AIN pin. To not violate rule 2, VDD must be 3.3 V or higher.Table 2 shows examples on maximum voltages that can be exposed to an ADC AIN pin, depending on the supply voltage and your prescaling settings

 

累了,搬书就搬到这里休息一会儿。留下问题?如何选择ADC的AIN管脚的分压电阻和电容呢?https://files.cnblogs.com/files/libra13179/ADC_voltage_divider.pdf

官方提供参考

https://devzone.nordicsemi.com/blogs/30/measuring-lithium-battery-voltage-with-nrf51/

 

posted on 2016-08-24 11:20  陌鉎こ城sHi  阅读(1918)  评论(0编辑  收藏  举报