melonchen:
你好啊,你可不可以把你的电路与程序发给我.请你帮我看看我下面这个电路有没有问题.[图片]500){this.resized=true;this.width=500;this.alt='这是一张缩略图,点击可放大。\n按住CTRL,滚动鼠标滚轮可自由缩放';this.style.cursor='hand'}"onclick="if(!this.resized){returntrue;}else{window.open('http://u.dianyuan.com/bbs/u/28/1113465210.gif');}"onmousewheel="returnimgzoom(this);">我用如下程序去读写RTC芯片,芯片好象没工作,测SQW端没有方波输出.我的程序如下:#include#include#defineDSAPBYTE[0x0a]/*寄存器A*/#defineDSBPBYTE[0x0b]/*寄存器B*/#defineDSCPBYTE[0x0c]/*寄存器C*/#defineDSDPBYTE[0x0d]/*寄存器D*/ /*0,1,2,3,4,5,6,7,8,9,10*/unsignedcharcodetable[]={0x05,0xDD,0x46,0x54,0x9C,0x34,0x24,0x5D,0x04,0x14,0xff};unsignedint new,old,temp,push;unsignedint bdatarel;unsignedchardisbuffer[8]; /*显示缓冲区*/unsignedcharpdata*addr=0x00;/*RTC地址*/voiddelayms(void){unsignedchari;for(i=200;i>0;i--){}}voiddisplay() /*显示与扫描按键函数*/{unsignedchar*p=disbuffer;unsignedchari;unsignedchardigit; /*位码*/bitpress=0; /*是否有按键标志*/ /*扫描是否有按键*/P3=P3|0x07; /*读入P3口低3位前先向该3位写1*/P1=0xff; /*数码管不显示*/P2=0x00; /*送全扫描字*/if(P3&0x07==0x07) /*判断是否有按键*/press=1; /*有按键,则有按键标志置1*/for(i=0,digit=0xfe;i