|
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
51hei.png (28.51 KB, 下載次數(shù): 50)
下載附件
2020-5-21 17:13 上傳
單片機(jī)源程序如下:
- #include <REG52.H>
- #include<intrins.h>
- #include"TLC549.H"
- /**
- **函數(shù)名:TLC549_adc
- **函數(shù)功能:TLC549 AD轉(zhuǎn)換程序
- **入口參數(shù):無
- **返回值:1個(gè),uchar類型
- **硬件資源:SCLK--P2.5,CS--P2.3,sdo---P2.2
- **/
- uchar TLC549_adc(void)
- {
- uchar i,n,temp=0;
- TLC549_DAT=1;
- TLC549_CS=1;
- TLC549_CLK=0;
- TLC549_CS=0;
- for(i=0;i<8;i++)
- {
- temp<<=1;
- temp |=TLC549_DAT;
- TLC549_CLK=1;
- for(n=0;n<2;n++);
- ……………………
- …………限于本文篇幅 余下代碼請從51黑下載附件…………
復(fù)制代碼
所有資料51hei提供下載:
TLC549.rar
(69.22 KB, 下載次數(shù): 123)
2020-5-20 15:15 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
|
|