|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2012-7-20 14:03:01
|
显示全部楼层
void send_232_char(unsigned char wdata)
{
bit b0,b1,b2,b3,b4,b5,b6,b7;
// EA = 0x00;
b0=wdata&0x01;
b1=wdata&0x02;
b2=wdata&0x04;
b3=wdata&0x08;
b4=wdata&0x10;
b5=wdata&0x20;
b6=wdata&0x40;
b7=wdata&0x80;
Send_PC=0; ///start bit
Delay_Send_PC_8us();
Send_PC=b0;
Delay_Send_PC_8us();
Send_PC=b1;
Delay_Send_PC_8us();
Send_PC=b2;
Delay_Send_PC_8us();
Send_PC=b3;
Delay_Send_PC_8us();
Send_PC=b4;
Delay_Send_PC_8us();
Send_PC=b5;
Delay_Send_PC_8us();
Send_PC=b6;
Delay_Send_PC_8us();
Send_PC=b7;
Delay_Send_PC_8us();
Send_PC=1; //stop bit
Delay_Send_PC_8us();
Send_PC=1;
Delay_Send_PC_8us();
// EA = 1;
} |
|