Madara
Newbie level 5
Why does the code below send continous no of 'U' in proteus simulation virtual terminal.I am using winavr for programming atmega8
By putting "cli();" instruction in ISR should have disabled interrupt. but 'U' is being continuously delivered.
what is the problem here??
By putting "cli();" instruction in ISR should have disabled interrupt. but 'U' is being continuously delivered.
what is the problem here??
Code:
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <avr/wdt.h>
int main(void)
{
UCSRC=0x86;
UBRRH=0;
UBRRL=0x67;
UCSRB=0xF8;
sei();
_delay_ms(200);
while(1)
wdt_reset();
}
ISR(USART_UDRE_vect)
{
cli();
UDR='U';
}