Defined function for setting the baud during runtime.

This commit is contained in:
Jake Goodwin 2023-01-14 11:36:13 -08:00
parent 6b73f1e513
commit 16492796be
1 changed files with 49 additions and 0 deletions

View File

@ -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 * Input: None
* Output: None * Output: None