Changing the baud rate on LPC54102

Questions on UARTs, and serial communication
basicchip
Posts: 740
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Changing the baud rate on LPC54102

Postby basicchip » Sat Nov 19, 2016 6:59 pm

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

Return to “Serial Communication”

Who is online

Users browsing this forum: No registered users and 1 guest