原创 通信问题

2006-9-23 16:21 2140 10 11 分类: MCU/ 嵌入式

利用中断进行的通讯:
void UART_Server(void) interrupt 4
{
    if(TI == 0)
    {
        //deal with send function
    }
    if(RI == 0)
    {
       //deal with receive function
    }
}


void T0_Server(void) interrupt 1
{
    //deal with your step motor
}


 void T0_Server(void) interrupt 1
{
    //deal with your step motor
    //adjust your T0 interrupt speed due to you step motor speed


void UART_Server(void) interrupt 4
{
    if(TI == 1)
    {
        //deal with send function
    }
    if(RI == 1)
    {
       //deal with receive function
    }
}
uchar crc = 0;//必须赋初值为0
for(i = 0; i < 512; i++)
{
    GetCRC(g_TempState,&crc);
}//可以连续计算


crc =~crc;//结果要取反。
最后要说的是我用的是8210校验。

PARTNER CONTENT

文章评论1条评论)

登录后参与讨论

用户292630 2014-12-12 00:50

很不错的深入分析, 值得学习.

用户1053025 2006-9-25 17:01

恭喜博主开博,期待你的佳作!
相关推荐阅读
我要评论
1
10
关闭 站长推荐上一条 /3 下一条