baudrate mystery was my bad code.

This commit is contained in:
Mariano Alvira 2009-03-30 16:11:08 -04:00
parent 880c75d989
commit 5fc1a9f224

View File

@ -17,8 +17,10 @@ void main(void) {
*(volatile uint32_t *)UART1_CON = 0x0000c800; /* mask interrupts, 16 bit sample --- helps explain the baud rate */ *(volatile uint32_t *)UART1_CON = 0x0000c800; /* mask interrupts, 16 bit sample --- helps explain the baud rate */
/* INC = 76; MOD = 1000 */ /* INC = 767; MOD = 9999 works: 115200 @ 24 MHz 16 bit sample */
*(volatile uint32_t *)UART1_BR = 0x004C03E8; /* Baud rate: (INC<<16 || MOD) */ /* is 115200 @ 24 MHz --- unexplained */ #define INC 767
#define MOD 9999
*(volatile uint32_t *)UART1_BR = INC<<16 | MOD;
/* see Section 11.5.1.2 Alternate Modes */ /* see Section 11.5.1.2 Alternate Modes */
/* you must enable the peripheral first BEFORE setting the function in GPIO_FUNC_SEL */ /* you must enable the peripheral first BEFORE setting the function in GPIO_FUNC_SEL */