Skip to content

Commit 3e7b9d7

Browse files
Joao Victor Santosjoao-victor-s
authored andcommitted
Update UART baud rate and Clock frequency
- Set LPC17XX clock to 18.432 MHz and update baud rate to 115200
1 parent c45a822 commit 3e7b9d7

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

port/ucontroller/nxp/lpc17xx/FreeRTOSConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ licensing and training services.
5252
#define configUSE_IDLE_HOOK 0
5353
#define configMAX_PRIORITIES ( 6 )
5454
#define configUSE_TICK_HOOK 0
55-
#define configCPU_CLOCK_HZ ( ( unsigned long ) 8000000)
55+
#define configCPU_CLOCK_HZ ( ( unsigned long ) 18432000)
5656
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
5757
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 80 )
5858
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 0x4000 ) )

port/ucontroller/nxp/lpc17xx/bootloader/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ int main(void)
200200
lp17_pincfg(0, 3, pin_mode_none, pin_func_alt1);
201201

202202
/*
203-
* Initialize UAR0 (19200bps, 8N1)
203+
* Initialize UAR0 (115200bps, 8N1)
204204
*/
205-
lpc17_uart0_init(19200, 72000000);
205+
lpc17_uart0_init(115200, 72000000);
206206

207207
if (fw_header->magic == 0xAAAAAAAA)
208208
{

port/ucontroller/nxp/lpc17xx/lpc17_uart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ void uart_init ( uint8_t id )
4040

4141
Chip_UART_Init( usart_cfg[id].ptr );
4242

43-
/* Standard 19200 baud rate */
44-
uart_set_baud( UART_DEBUG, 19200 );
43+
/* Standard 115200 baud rate */
44+
uart_set_baud( UART_DEBUG, 115200 );
4545

4646
/* Defaults to 8N1, no parity */
4747
uart_config_data( UART_DEBUG, ( UART_LCR_WLEN8 | UART_LCR_SBS_1BIT | UART_LCR_PARITY_DIS ) );

port/ucontroller/nxp/lpc17xx/lpcopen/src/sysinit_17xx_40xx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ void Chip_SetupIrcClocking(void)
7373
Chip_Clock_EnablePLL(SYSCTL_MAIN_PLL, SYSCTL_PLL_CONNECT);
7474
}
7575

76-
#define CLOCK_8MHZ
76+
#define CLOCK_18_432MHZ
77+
#ifdef CLOCK_18_432MHZ
78+
#define PLL_M (144-1)
79+
#define PLL_N (5-1)
80+
#define CLK_DIV (25-1)
81+
#endif
7782
#ifdef CLOCK_100MHZ
7883
#define PLL_M (25-1)
7984
#define PLL_N (2-1)

0 commit comments

Comments
 (0)