diff --git a/avr_usart.c b/avr_usart.c index fc833ad..0f42ee5 100644 --- a/avr_usart.c +++ b/avr_usart.c @@ -113,6 +113,55 @@ unsigned char rx_usart0(void) { } +/* + * Inupt: None + * Output: None + * Description: + */ + + +/* + * Inupt: None + * Output: None + * Description: + */ + + +/* + * Inupt: None + * Output: None + * Description: + */ + + +/* + * Inupt: None + * Output: None + * Description: + */ + + + + +/* + * Inupt: BUAD RATE as uint8_t + * Output: None + * Description: Sets the baud rate of the serial usart0 + * VALUES @ 1Mhz: + * 207 --> 300bps + * 103 --> 600bps + * 51 --> 1200bps + * 25 --> 2400bps + * 12 --> 4800bps + * 6 --> 9600bps !!! 7% error rate + */ + +void serial0_set_baud(uint8_t buad) { + UBRR0H |= (uint8_t) (baud>>8); + UBRR0L |= (uint8_t) baud; +} + + /* * Input: None * Output: None