
$ cat /dev/urandom > /dev/ttyS0
$ make reset (reset через LPT)
код,
CODE
void uart_open( uint8_t scale )
{
UBRRH = 0;
UBRRL = scale;
UCSRA = (1<<1);
UCSRB = (1<<4) | (1<<3);
UCSRC = (1<<7) | (1<<2) | (1<<1);
DDRD |= (1<<1);
DDRD &= ~(1<<0);
PORTD |= (1<0);
}
void uart_send( uint8_t data )
{
while ( ( UCSRA & (1<<5) ) == 0 ) ;
UDR = data;
}
uint8_t uart_recv()
{
while ( ( UCSRA & (1<<7) ) == 0 ) ;
return UDR;
}