智能车制作

标题: 串口通信问题 [打印本页]

作者: SYK    时间: 2013-10-4 12:33
标题: 串口通信问题
void main(void)
{
    //1 主程序使用的变量定义
    uint32 runcount;  //运行计数器
   
    //2 关中断
    DisableInterrupts;      //禁止总中断
   
    //3 模块初始化
    light_init(Light_Run_PORT,Light_Run1,Light_OFF); //指示灯初始化
    uart_init (UART0,periph_clk_khz,9600);    //串口初始化
    //4 开中断
   // enableuartreint(UART0,UART0irq);  //开串口0接收中断
    //EnableInterrupts;           //开总中断
   
    uart_sendN(UART0,(uint8*)"Hello World!",12);
    //主循环
    while(1)
    {
        //1 主循环计数到一定的值,使小灯的亮、暗状态切换
        runcount++;
        if(runcount>=5000000)
        {
            light_change(Light_Run_PORT,Light_Run1);//指示灯的亮、暗状态切换
            runcount=0;
        }   
    }
}
用的是pl2303串口转换通信,程序下进去了,小灯也闪烁,但调试助手一点反应也没有啊!郁闷。。。

作者: SYK    时间: 2013-10-4 14:11
串口0跟其他串口有区别么串口




欢迎光临 智能车制作 (http://dns.znczz.com/) Powered by Discuz! X3.2