Thread 中讨论的其他器件:EK-TM4C1294XL
工具与软件:
您好!
我将使用 TM4C1294NCPDT 的 ADC 端口来读取分压器的电压、其中分压器的 R1 (顶部的电阻器)
为1千欧姆、R2 (底部的电阻器)为0.2欧姆分流电阻器。 从我从微控制器手册中读到的内容、
当基准为3.3V 时、ADC 引脚可以读取高于805.66微伏的电压。
分压器的结果是970.3微伏、但在编译程序时、似乎自调试以来引脚上没有电压
编程并观察我指定变量的值、结果为随机电压值、当我使用万用表确认时
计算器电压(约为1mV)。
我要使用的引脚是引脚20、对应于 ADC 的 PK2和通道18。 我最终想用负载和同时监控 PK0和 PK1
类似于我现在要测试的电压。
您能给我什么建议来复习一下吗?
此致、
MayraFullscreen123456789101112131415161718192021#include <stdint.h>#include <stdbool.h>#include <string.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include "inc/hw_types.h"#include "inc/hw_memmap.h"#include "inc/hw_gpio.h"#include "driverlib/sysctl.h"#include "driverlib/pin_map.h"#include "driverlib/gpio.h"#include "driverlib/adc.h"#include "driverlib/debug.h"#include <driverlib/uart.h>#include <driverlib/interrupt.h>#include "inc/hw_ints.h" //librería para interrupciones#include <stdbool.h>#include "utils/uartstdio.h"#include "utils/uartstdio.c"