No.48077 作者:sunyouyuan 邮件:syyhcl@163.com ID:119857 登陆:1次 文章数:2篇 最后登陆IP:218.19.70.85 最后登陆:2008/11/21 16:21:08 注册:2008/11/13 11:04:12 财富:107 发帖时间:2008/11/17 10:50:14 发贴者IP:218.19.73.4 标题:sunyouyuan:[求助]AD7705没有工作 摘要:No.48077[求助]AD7705没有工作 [color=#9400D3] 各位大哥大姐帮下忙谢谢了先! DRDY一直为高电平,AD7705似乎没有工作 #include <stc89c58.h> #include <intrins.h> sbit addata = P3^0 ; sbit sclk = P3^1 ; sbit drdy = P2^7 ; sbit LED=P4^1; sbit AD7705_CS=P2^5; //片选// sbit AD7705_RESET=P2^4; //复位// #define uchar unsigned char #define uint unsigned int void wrbyt(uchar shu); int rdbyt( ); void ad7705_init( void ) ; void delay(uchar t); /************************************************/ //写一个字节// void wrbyt( uchar shu ) { uchar i ; AD7705_CS=0; // CS ON sclk=1; _nop_(); _nop_(); for(i=0;i <8;i ++) { addata=(bit)(shu&0x80); sclk = 0 ; _nop_(); _nop_(); _nop_(); sclk = 1 ; shu = shu < <1 ; } _nop_(); AD7705_CS=1; //CS OFF } /************************************************/ //读一个字// int rdbyt( void ) { int temp ; uchar j ; AD7705_CS=0; ......
>>返回讨论的主题
|