|
msp430中iic的主函数程序请大虾看看对不
[复制链接]
void main(void)
{
unsigned char *sdd,*rdd;
unsigned char aa[8];
unsigned int i,k;
WDTCTL=WDTPW+WDTHOLD;
for(i=0;i<8;i++){
aa=0x50;
sdd=aa;
Write_Date(0xA0,sdd,8);
delay(100);
Read_Date(0xA1,rdd,8);
delay(100);
char f[]={0x5F,0x50,0x3D,0x79,0x72,0x6B,0x6F,0x51,0x7F,0x7B};
FLL_CTL0|=XCAP14PF;
BTCTL=BTSSEL+BTDIV+BTFRFQ0+BTIP2+BTIP1+BTIP0;//时钟
P5SEL=0xfc;//选用第二功能
LCDCTL=LCDP1+LCD4MUX+LCDON;//LCD初始化
// for(j=0;j<9;j++)
// LCDMEM[j]=0x00;
delay(0xff);
for(k=0;k<9;k++)
{
if(f[k]==*rdd)
LCDMEM=f[k];
}
sdd++;}
}
|
|