#include
unsigned char zifu;void Port_Init(void);
void Usart_Init(void);
void Usart_PutChar(unsigned char data);
int main(void)
{
Port_Init();
Usart_Init();
zifu = 0x31;
Usart_PutChar(zifu);
sei();
while(1)
{
}
}
void Port_Init()
{
PORTD = 0x00;
DDRD |= (1 << PD1);
}
void Usart_Init()
{
UCSRA = 0x00;
UCSRC |= (1<
UBRRL = (F_CPU / 9600 / 16 - 1) % 256; UBRRH = (F_CPU / 9600 / 16 - 1) / 256;
UCSRB |= (1 << TXEN);
}
void Usart_PutChar(unsigned char data)
{
while( !(UCSRA & (1 << UDRE)) );
UDR = data;
}