Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

MSP430F1611 UART Problem - 115200bps - SMCLK 1MHz

$
0
0

Hi all,

I'm trying to develop a small program that sends every second 1 byte on the uart using the MSP430F1611.

The MCU is working at 4096 binary kHz, and I want to use a baudrate of 115200bps for the serial interface.

SMCLK is set as (DCO_KHZ / 4) = 4096 / 4 = 1024 binary kHz ( = 1024 * 1024 = 1048576 Hz)

My current configuration for the registers U1BR0, U1BR1 and U1MCTL is:

U1BR0 = 0x09;   // ( = 1048576 / 115200 )

U1BR1 = 0x00;   

U1MCTL = 0x10; 

 

The problem is that the bytes I'm receiveing on the PC aren't correct.

The software on the MCU should send on the uart one counter byte every second, for example:

0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E....

However on the PC I'm receveing this sequence:

0x80, 0x81, 0x82, 0x83, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x84, 0x85, 0x86.....

 

I noticed that using a baudrate of 9600bps with ACLK as source clock the program is working correctly and I receive the correct bytes on the PC.

Configuration for 9600bps is U1BR0 = 0x03; U1BR1 = 0x00; U1MCTL = 0x4a;

 

Thanks for any suggestions.

 

Regards.

Samuele Forconi.


Viewing all articles
Browse latest Browse all 262198

Trending Articles