I need to use the UART at a rate other than what is supported. How can I specify a new baud rate?
First, the developer needs to determine if the baud rate is possible with the Em250. The BAUD rate generator is based on a 12 MHz clock (24 MHz main crystal divided by 2). To generate the correct BAUD rate, the developer needs to specify a divide ratio from 12 MHz to generate the correct bit rate. For example, if I wish to generate a 115.2 kbps BAUD rate, I would need to use a divide ratio of 12 MHz / 115.2 kHz = 104.
Note that this actually specifies a
BAUD rate of 115.384, which is about 0.16% faster than true 115.2
kbps. BAUD rates must be within 5% to avoid bit errors, assuming the
device on the other end is precise. It is usually a good idea to stay
within 2.5% on both sides to be sure.
Once the divide ratio has been computed, it needs to be defined as EMBER_SERIAL_BAUD_CUSTOM in the board file. An example may be found in hal/micro/xap2b/em250/board/dev0455.h in our EmberZNet 2.5.3 release. From within the application, the developer should select BAUD_CUSTOM when initializing the serial port.
- Login to post comments









