baudrate mystery was my bad code.
This commit is contained in:
parent
880c75d989
commit
5fc1a9f224
1 changed files with 4 additions and 2 deletions
|
@ -17,8 +17,10 @@ void main(void) {
|
|||
|
||||
*(volatile uint32_t *)UART1_CON = 0x0000c800; /* mask interrupts, 16 bit sample --- helps explain the baud rate */
|
||||
|
||||
/* INC = 76; MOD = 1000 */
|
||||
*(volatile uint32_t *)UART1_BR = 0x004C03E8; /* Baud rate: (INC<<16 || MOD) */ /* is 115200 @ 24 MHz --- unexplained */
|
||||
/* INC = 767; MOD = 9999 works: 115200 @ 24 MHz 16 bit sample */
|
||||
#define INC 767
|
||||
#define MOD 9999
|
||||
*(volatile uint32_t *)UART1_BR = INC<<16 | MOD;
|
||||
|
||||
/* see Section 11.5.1.2 Alternate Modes */
|
||||
/* you must enable the peripheral first BEFORE setting the function in GPIO_FUNC_SEL */
|
||||
|
|
Loading…
Reference in a new issue