智能车制作
标题:
SCI 通信问题
[打印本页]
作者:
zhouzhou1988
时间:
2011-4-19 12:06
标题:
SCI 通信问题
本帖最后由 zhouzhou1988 于 2011-4-19 12:08 编辑
#include <hidef.h> /* common defines and macros */
#include <mc9s12dp512.h> /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12dp512"
void SciInit()
{
SCI0BD=52; //9600bps Baud Rate=BusClock/(16*SCIBD)
SCI0CR1=0xa0; //正常8位模式,无奇偶校验
SCI0CR2=0X2C; //发送允许 接受中断允许
}
//-----------------写SCI数据---------------------------------//
void SciWrite(unsigned char sendchar)
{
while (!SCI0SR1_TDRE);
SCI0DRH=0;
SCI0DRL=0X45;
}
//------------------------main----------------------------------//
void main(void)
{
DDRA=0XFF;
SciInit();
SciWrite(0xff) ;
EnableInterrupts;
for(;;)
{
} /* wait forever */
/* please make sure that you never leave this function */
}
高手帮看看,程序是否有问题,我发送端口怎么没数据输出呢?
作者:
laoniuxxj
时间:
2011-4-23 16:54
没读呢
欢迎光临 智能车制作 (http://111.231.132.190/)
Powered by Discuz! X3.2