Page 1 of 1

Changing the baud rate on LPC54102

Posted: Sat Nov 19, 2016 6:59 pm
by basicchip
The UARTs of the LPC54102 share the same baud rate clock. By default UART0 is setup for 115Kb.

The proper way to change the baud rate for other UARTs is to first set it to 115Kb, then poke the BRG register

Code: Select all

#define UART2_BRG	*(&H4008C020)

BAUD(2)=115200

UART2_BRG = 77		'  12 MHz PCLK / 9600baud / 16 - 1
for i=0 to 9
  txd(2)=&H30+i
  wait(1000)
next