#include <avr/io.h>
#include <avr/interrupt.h>
uint8_t dato = 0x20;
ISR(INT0_vect){
while(!(UCSR0A & 1 << UDRE0));
UDR0= dato;
dato = (dato = 0x7E)? 0x20: dato+1;
}
ISR(USART_RX_vect){
PORTB = UDR0;
}
int main(){
DDRD = 0x02;
PORTD = 0x04;
DDRB = 0xFF;
EICRA = 0x02;
EIMSK = 0x01;
UBRR0 = 12;
UCSR0A = 0x00;
UCSR0B = 0x98;
UCSR0C = 0x06;
sei ();
while (1)
asm ("NOP");
}