查看EFM32的源代码
←
EFM32
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== ADC == === Overview === * 1.25 V internal bandgap * 2.5 V internal bandgap * Vdd * 5 V internal differential bandgap * External single ended input from Ch 6 * Differential input, 2x(Ch 6 - Ch 7) * The 2.5 V reference needs a supply voltage higher than 2.5 V * The differential 5 V reference needs a supply voltage higher than 2.75 V <br> === Pin map === * PIN14_PD7 ---> T2_J2_T ---> 1K ---> PIN17_PC14 (PRS_CH0,拉高作供电) ------- PIN13_PD6 * PIN13_PD6 (ADC0_CH6),测供电电压 * PIN14_PD7 (ADC0_CH7),测 Pt 对地电压(Pt 阻值) <br> === Differential === <source lang=cpp> adc.reference(INTERNAL3V3); Serial.print("ADC differential ch6 ch7 read:"); Serial.println(adc.read(A6, A7)); /* Positive Ch6, negative Ch7. */ Serial.print("ADC6 = "); Serial.println(adc.read(A6)); Serial.print("ADC7 = "); Serial.println(adc.read(A7)); </source> '''Result:''' <source lang=bash> # A6 <--- I/O output HIGH # A7 <--- pull up to Vbat ADC differential ch6 ch7 read:1 ADC6 = 4091 ADC7 = 4090 ############################## # A6 <--- I/O output LOW # A7 <--- pull up to Vbat ADC differential ch6 ch7 read:-2048 ADC6 = 0 ADC7 = 4092 </source> 即:分辨率依然是 12bit,就是把参考电压分成 4096 份,差分的话就是上极限是 2047,下极限就是 -2048。 如上 A6 接高电位,A7 接低电位,差分输出为 1,参考电压 3.3V,则压降为 3.3/4096 '''T2:''' <source lang=bash> # 开路 08-31 15:35:08:717]ADC differential ch6 ch7 read:0 [08-31 15:35:08:717]ADC6 = 4088 [08-31 15:35:08:717]ADC7 = 4087 [08-31 15:35:08:717]Vbat = 3.270 [08-31 15:35:10:707]ADC differential ch6 ch7 read:0 [08-31 15:35:10:707]ADC6 = 4088 [08-31 15:35:10:707]ADC7 = 4087 [08-31 15:35:10:722]Vbat = 3.276 [08-31 16:19:41:132]ADC differential ch6 ch7 read:-1 [08-31 16:19:41:132]ADC6 = 4086 [08-31 16:19:41:132]ADC7 = 4086 [08-31 16:19:41:146]Vbat = 3.272 [08-31 16:19:43:149]ADC differential ch6 ch7 read:-2 [08-31 16:19:43:149]ADC6 = 4086 [08-31 16:19:43:149]ADC7 = 4085 [08-31 16:19:43:149]Vbat = 3.274 # 短路: [08-31 15:36:13:272]ADC differential ch6 ch7 read:2047 [08-31 15:36:13:272]ADC6 = 4007 [08-31 15:36:13:298]ADC7 = 0 [08-31 15:36:13:298]Vbat = 3.256 [08-31 15:36:15:287]ADC differential ch6 ch7 read:2047 [08-31 15:36:15:303]ADC6 = 4008 [08-31 15:36:15:303]ADC7 = 0 [08-31 15:36:15:303]Vbat = 3.257 </source> 重启、上电启动、状态不稳时,ADC 的可能有异常值(经确认,手拿导体接 T 口,会导致 a7 > a6,如 a7=4095 a6 = 4085,此即会使 Rt 值异常大。。。): <source lang=bash> [08-31 15:46:55:636]PT1000 testing start... [08-31 15:46:55:711]Rt = 4290872296 [08-31 15:46:55:711]time = 38 [08-31 15:46:55:711]Temperature = -276.0 'C [08-31 15:46:58:722]Rt = 22445801 [08-31 15:46:58:722]time = 38 [08-31 15:46:58:722]Temperature = -276.0 'C </source> <br>
返回到
EFM32
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面