请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TM4C123GH6PM 大家好、
我尝试使用 Tiva 芯片上的 PE2来读取模拟输入。 我找到了下面的示例、并尝试对其进行编辑以读取该端口、但我只得到大约287的值。
奇怪的是、无论输入电压是多少、读入的第一个值的值仍然为+/- 3。 但是、如果我复位程序、我会看到大约20个跳变 (例如、如果我将输入电压降低0.2V。)
我忘记设置或重置某个内容了吗? 我应该使用其他示例吗?
(我不想使用 uDMA 例程、该示例看起来过于复杂、每隔几秒只需简单读取一次。)
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//*****************************************************************************
//
// single_ended.c - Example demonstrating how to configure the ADC for
// single ended operation.
//
// Copyright (c) 2010-2020 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
感谢您提供任何指导。 我知道我缺少一些简单的东西。
Bob