我现在在用R8C/1A,但是调试I2C和串口老有问题,I2C我拷贝以前我R8C/11的一个程序(用IO口模拟出来的总线),但是老不行,我自己现在想用寄存器编写,但是也不OK,版主或者哪位仁兄有相关例程能否让小弟看看!!!串口也是这样,感觉没错啊,下面贴上串口程序,有什么问题?
UART0初始化////////////////
void uart0init(void)
{
u0mr=0x65; // 8bit,uart mode ,no check ,inner clock,one stop bit
u0c0=0x00; //f1 clock,lsb
u0rrm=0; // Continuous receive mode disabled
u0brg=0x47; //mainclock=11.0592M,9600bps
re_u0c1=1; // Reception enabled /
}
发送/////////////////////
void uart0send(void)
{
unsigned int i;
delay(1000);
while(!ti_u0c1);
u0tb=0x55;
while(!ti_u0c1);
u0tb=0x55;
while(!ti_u0c1);
u0tb=0x55;
while(!ti_u0c1);
u0tb=0x55;
}
关键词:
以及
串口
通讯
问题