Sign in

username:

password:



Not a member?

Search msp430



Search tips

Subscribe to msp430



Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | MSP430 | Framing errors during transmit

The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.

Framing errors during transmit - "muk...@ymail.com" - Sep 24 12:54:21 2009

Hello,
I am facing a peculiar problem using MSP430F5437. All my questions are related to serial comm.
1) I am using a baud rate of 9600, sourced from smclk, which i believe is 1.04 MHZ. I always have to use ucos=1 to get this baud. If I try generating this baud wihtout oversampling, My device cannot communicate. Below is the code I am using to set the baud. Is there a way I can get 9600 without using oversampling?
UCA0CTL1 |= 0x01;
UCA0CTL0 |= UCMODE1; // Address bit transmission
UCA0CTL0 |= UC7BIT; // 7 bit data
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 6;
UCA0BR1 = 0;
UCA0MCTL = UCBRS_0 + UCBRF_13 + UCOS16;
UCA0CTL1 |= UCDORM ; // Message with address byte will generate int
UCA0CTL1 &= ~UCSWRST; // RESET USCI state machine
UCA0IE |= UCRXIE; // Enable USCI_A0 RX

2) I am using a RS-485 convertor. When I transmit a byte, i enable listen on the serial port. this result an Rx interrupt when the byte is tx on the line. In the interrupt I drive the rs-485 line low so that MSP430 switches back to rx mode. After some period of running, I get framing error in the byte that was tx by the MSP430. I dont get framing errors on received data. As a result my MSP430 gets stuck in transmit mode. I have a timer which start counting when I put a byte in txbuffer, and stops when I listen the byte in the rx interrupt. In case of framing error, rx interrupt never occurs, so the timer times out. In the debugger I see the txinterrupt bit set, but I am unable to figure out a way to clear it.

I hope some1 can point me in the right direction.

thanks
Muk

------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )