Added ability to set the serial baud rate via the user's terminal in the XPLAINBridge project.
This commit is contained in:
parent
40631e9fe5
commit
dfe50ff349
9 changed files with 40 additions and 15 deletions
|
@ -63,12 +63,13 @@ void SoftUART_Init(void)
|
|||
EICRA = (1 << ISC01);
|
||||
EIMSK = (1 << INT0);
|
||||
|
||||
/* Set reception timer compare period and enable compare ISR */
|
||||
OCR1A = BIT_TIME;
|
||||
/* Set the transmission and reception timer compare values for the default baud rate */
|
||||
SoftUART_SetBaud(9600);
|
||||
|
||||
/* Setup reception timer compare ISR */
|
||||
TIMSK1 = (1 << OCIE1A);
|
||||
|
||||
/* Set transmission timer compare period, enable compare ISR and start the timer */
|
||||
OCR3A = BIT_TIME;
|
||||
/* Setup transmission timer compare ISR and start the timer */
|
||||
TIMSK3 = (1 << OCIE3A);
|
||||
TCCR3B = ((1 << CS30) | (1 << WGM32));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue