#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
sbit DATA=P2^0;
sbit SCLK=P2^1;
sbit CS=P2^2;
sbit FS=P2^3;
sbit k1=P1^7;
void delayms(uchar i)
{
uchar j;
while(i--)
for(j=0;j<120;j++);
}
void writedata(uint x)
{
uchar j;
CS=0;
FS=0;
SCLK=1;
_nop_();
_nop_();
for(j=0;j<16;j++)
{
DATA=((bit)(x|0x8000)&0x8000);
_nop_();
_nop_();
_nop_();
SCLK=0;
_nop_();
_nop_();
x<<=1;
SCLK=1;
_nop_();
_nop_();
_nop_();
}
_nop_();
_nop_();
_nop_();
CS=1;
FS=1;
_nop_();
_nop_();
_nop_();
_nop_();
}
void main(void)
{
while(1)writedata(4000);
}
求解此程序为什么驱动不了TLV5616,谢谢!