|
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
0.png (14.85 KB, 下載次數(shù): 88)
下載附件
2019-8-8 16:17 上傳
單片機(jī)源程序如下:
- /*----------------------Item Description-----------------------------------
- - Project Name : TLC1543.c
- - Files :
- - Description : None
- - IDE : Keil uVision4
- - Author : Mason 別名:小菜
- - Email Address : 1609099954@qq.com
- - Create Date : 2013/7/27
- - Performance : Finished
- - -------------------------------------------
- - Revision History
- - No. Date Revised by Item Description
- -
- -------------------------------------------------------------------------*/
- #include <reg52.h>
- #include "MICRO.h"
- #include "LCD1602.h"
- #include "TLC1543.h"
- void main()
- {
- uint16 volt;
- LCD1602_Init(); // LCD1602上電初使化
- draw1602_basic();
- TLC1543_init();
- while(1)
- {
- volt = ReadADC_TLC1543(0);
- write1602_DDRAM_pos(7,1);
- write1602_byte(volt/1000+0x30,1);
- write1602_byte(volt/100%10+0x30,1);
- write1602_byte(volt/10%10+0x30,1);
- write1602_byte(volt%10+0x30,1);
- }
- }
復(fù)制代碼- /*----Head Description----
- - File Name : TLC1543.H
- - Author : Mason 別名:小菜
- - Create Date : 2013/7/26
- - -------------------------------------------
- - Revision History
- - No. Date Revised by Item Description
- -
- -------------------------------------------------------------------------*/
- #ifndef _TLC1543_H_
- #define _TLC1543_H_
- /*----------------------------Head---------------------------------------*/
- #include <reg52.h>
- #include "MICRO.h"
- /*----------------------------Interface----------------------------------*/
- sbit EOC_1543 = P3^7;
- sbit SCLK_1543 = P3^5;
- sbit ADDR_1543 = P3^3;
- sbit DOUT_1543 = P3^2;
- sbit CS_1543 = P3^4;
- /*----------------------------Function Declaration-----------------------*/
- uint16 ReadADC_TLC1543(uchar ain);
- void TLC1543_init(void);
- #endif
復(fù)制代碼
所有資料51hei提供下載:
TLC1543.7z
(48.07 KB, 下載次數(shù): 87)
2019-8-8 16:18 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
|
評分
-
查看全部評分
|