一、实验要求 利用51单片机设计一个数字电压表,实现从模拟信号输入到数字信号输出的基本功能,具体要求如下: (1)通过滑动变阻器改变输入电压; (2)利用AD转换器ADC0832将输入电压转换为数字信号送到单片机; (3)在LCD上显示输入电压值,保留三位小数; (4)在电压测量值后面显示单位“V”。
Using C51 MCU to design a digital voltmeter achieve from the analog signal input to the basic functions of digital signal output. (1) Change the input voltage by sliding the rheostat; (2) Using the AD converter ADC0832 to convert the input voltage to a digital signal to the MCU; (3) The input voltage value is displayed on the LCD, leaving three decimal places; (4) After the voltage measurement value shows the unit "V".
二、实验任务 本系统以51单片机作为控制核心,实现LCD显示的控制、AD转换器的启动与数据读入,并协调和控制各个模块的工作。
The system uses C51 MCU as the control core, to achieve LCD display control, AD converter start and data read, and coordinate and control the work of each module
四、硬件电路
五、实验程序
六、思考题回答
(1)A/D或 D/A中的D和A是什么意思,A/D和D/A分别有什么作用? What is the meaning of D and A in A/D or D/A?what are the functions of A/D and D/A?
Answer:A is analog , D is digital . A/D can change analog signals into digital signals . D/A can change digital signals into analog signals.
(2)C51程序中为什么要包含头文件reg51.h? Why does the C51 program include the header file reg51.h?
Answer:Because reg51.h has function declarations , variable declarations , if you want to use these functions or variables you have to include them.
|