|
|
void setup()
{
..............
uart0_init();
attachInterrupt(0,caliberation,RISING);
}
void uart0_init(void)
{
UCSR0B=0x00;
UCSR0A=0x00;
UCSR0C=0x06;//8,1,n,0
UBRR0=BAUD_RATE_DIVISOR;
UCSR0B=0X98;//receive interrupt,receive, send enable
}
void loop()
{.......
本程序用串口中断接收数据(RX0,TX0),但外部中断发生后,串口中断就无效,搞了半年 都未解决 求助各位高手 谢谢 |
|