一、實驗要求 利用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.
|