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.
UART communication Baud Rate problem (F2617 <-> F448) - kshot2u - Aug 13 3:00:24 2009
Hi I am A Graduate school student in korea. ^^
I want to communicate between F2617 and F448 using UART.
F2617 SMCLK is 8MHz and F448 SMCLK is 4MHz. Baud rate is 115200Hz.
But they have the difference in bit durations and intervals.
Speed is not the same.
So the result of read data was wrong.
I think it is my mistake that setting the registers.
How I can equalize the bit durations?
Followings are my IAR codes.
1. F2617 code
void SetUART1 (void)
{
UCA1CTL1 |= UCSWRST;
UCA1CTL0 = 0; // no parity, 1 stop bits, 8-bit data
UCA1CTL1 = UCSSEL_3; // SMCLK
//UCA1MCTL = UCOS16;
UCA1BR1 = 0x00;
UCA1BR0 = 69; // 8 Mhz, 115200 bps
UCA1MCTL |= UCBRS_4; // 8 Mhz, 115200 bps
UCA1CTL1 &= ~UCSWRST; // USART reset released for operation
UC1IE = UCA1RXIE;
}
while(1)
{
while (!(IFG2&UCA1TXIFG));
UCA1TXBUF=0x11;
for(int k=0;k<1000;k++);
while (!(IFG2&UCA1TXIFG));
UCA1TXBUF=0x22;
for(int k=0;k<1000;k++);
}
#pragma vector = USCIAB1RX_VECTOR
__interrupt void USCIAB1_RxInterrupt (void)
{
if (UC1IFG & UCA1RXIFG)
Rx1_Buffer = UCA1RXBUF;
}
2. F448 codes
void SetUART1 (void)
{
UCTL1 |= SWRST; // set SWRST
ME2 |= UTXE1 | URXE1; // Enable USART1 TXD/RXD
UCTL1 |= CHAR; // 8-bit character
UTCTL1 |= SSEL1; // UCLK = SMCLK
U1BR0 = 0x69; // 4MHz / 115200 = 34.7
U1BR1 = 0x00;
UMCTL1 = 0x00; // modulation
UCTL1 &= ~SWRST; // UART1 reset released for operation
IE2 |= URXIE1; // Enable USART0 RX interrupt
}
while(1)
{
while (!(IFG2 & UUTXIFG1));
U1TXBUF = 0x11;
for(int k=0;k<1000;k++);
while (!(IFG2 & UTXIFG1));
U1TXBUF = 0x22;
for(int k=0;k<1000;k++);
}
#pragma vector=USART1RX_VECTOR
__interrupt void usart1_rx (void)
{
while (!(IFG2 & URXIFG1));
Rx1_Buffer = U1RXBUF;
}
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: UART communication Baud Rate problem (F2617 <-> F448) - Microbit_Ubuntu - Aug 13 3:14:11 2009
On Thu, 2009-08-13 at 06:32 +0000, kshot2u wrote:
> Hi I am A Graduate school student in korea. ^^
>
> I want to communicate between F2617 and F448 using UART.
>
> F2617 SMCLK is 8MHz and F448 SMCLK is 4MHz. Baud rate is 115200Hz.
>
> But they have the difference in bit durations and intervals.
>
> Speed is not the same.
>
> So the result of read data was wrong.
>
> I think it is my mistake that setting the registers.
>
> How I can equalize the bit durations?
>
> Followings are my IAR codes.
>
> 1. F2617 code
>
> void SetUART1 (void)
> {
> UCA1CTL1 |= UCSWRST;
>
> UCA1CTL0 = 0; // no parity, 1 stop bits, 8-bit data
> UCA1CTL1 = UCSSEL_3; // SMCLK
> //UCA1MCTL = UCOS16;
> UCA1BR1 = 0x00;
> UCA1BR0 = 69; // 8 Mhz, 115200 bps
> UCA1MCTL |= UCBRS_4; // 8 Mhz, 115200 bps
>
> UCA1CTL1 &= ~UCSWRST; // USART reset released for operation
> UC1IE = UCA1RXIE;
> }
>
> while(1)
> {
> while (!(IFG2&UCA1TXIFG));
> UCA1TXBUF=0x11;
> for(int k=0;k<1000;k++);
>
> while (!(IFG2&UCA1TXIFG));
> UCA1TXBUF=0x22;
> for(int k=0;k<1000;k++);
> }
>
> #pragma vector = USCIAB1RX_VECTOR
> __interrupt void USCIAB1_RxInterrupt (void)
> {
> if (UC1IFG & UCA1RXIFG)
> Rx1_Buffer = UCA1RXBUF;
> }
>
> 2. F448 codes
>
> void SetUART1 (void)
> {
>
> UCTL1 |= SWRST; // set SWRST
> ME2 |= UTXE1 | URXE1; // Enable USART1 TXD/RXD
> UCTL1 |= CHAR; // 8-bit character
> UTCTL1 |= SSEL1; // UCLK = SMCLK
> U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> U1BR1 = 0x00;
> UMCTL1 = 0x00; // modulation
> UCTL1 &= ~SWRST; // UART1 reset released for operation
> IE2 |= URXIE1; // Enable USART0 RX interrupt
> }
>
> while(1)
> {
> while (!(IFG2 & UUTXIFG1));
> U1TXBUF = 0x11;
> for(int k=0;k<1000;k++);
>
> while (!(IFG2 & UTXIFG1));
> U1TXBUF = 0x22;
> for(int k=0;k<1000;k++);
> }
>
> #pragma vector=USART1RX_VECTOR
> __interrupt void usart1_rx (void)
> {
> while (!(IFG2 & URXIFG1));
> Rx1_Buffer = U1RXBUF;
> }
>
> ------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.
(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: UART communication Baud Rate problem (F2617 <-> F448) - old_cow_yellow - Aug 13 3:49:52 2009
(1) To fix the F448 baud, replace the lines:
U1BR0 = 0x69; // 4MHz / 115200 = 34.7
U1BR1 = 0x00;
UMCTL1 = 0x00; // modulation
by the lines:
U1BR0 = 34; // 4MHz / 115200 = 34.7
U1BR1 = 0x00;
UMCTL1 = 0xDD; // modulation
(2) Are the two playing ping-pong? But which one starts the first shot? Look to me they
will wait for each other forever and nothing will happen.
(3) Polling for the TXRDY flag inside the RX ISR is prudent but silly. (Ha Ha)
--- In m...@yahoogroups.com, "kshot2u"
wrote:
>
> Hi I am A Graduate school student in korea. ^^
>
> I want to communicate between F2617 and F448 using UART.
>
> F2617 SMCLK is 8MHz and F448 SMCLK is 4MHz. Baud rate is 115200Hz.
>
> But they have the difference in bit durations and intervals.
>
> Speed is not the same.
>
> So the result of read data was wrong.
>
> I think it is my mistake that setting the registers.
>
> How I can equalize the bit durations?
>
> Followings are my IAR codes.
>
> 1. F2617 code
>
> void SetUART1 (void)
> {
> UCA1CTL1 |= UCSWRST;
>
> UCA1CTL0 = 0; // no parity, 1 stop bits, 8-bit data
> UCA1CTL1 = UCSSEL_3; // SMCLK
> //UCA1MCTL = UCOS16;
> UCA1BR1 = 0x00;
> UCA1BR0 = 69; // 8 Mhz, 115200 bps
> UCA1MCTL |= UCBRS_4; // 8 Mhz, 115200 bps
>
> UCA1CTL1 &= ~UCSWRST; // USART reset released for operation
> UC1IE = UCA1RXIE;
> }
>
> while(1)
> {
> while (!(IFG2&UCA1TXIFG));
> UCA1TXBUF=0x11;
> for(int k=0;k<1000;k++);
>
> while (!(IFG2&UCA1TXIFG));
> UCA1TXBUF=0x22;
> for(int k=0;k<1000;k++);
> }
>
> #pragma vector = USCIAB1RX_VECTOR
> __interrupt void USCIAB1_RxInterrupt (void)
> {
> if (UC1IFG & UCA1RXIFG)
> Rx1_Buffer = UCA1RXBUF;
> }
>
> 2. F448 codes
>
> void SetUART1 (void)
> {
>
> UCTL1 |= SWRST; // set SWRST
> ME2 |= UTXE1 | URXE1; // Enable USART1 TXD/RXD
> UCTL1 |= CHAR; // 8-bit character
> UTCTL1 |= SSEL1; // UCLK = SMCLK
> U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> U1BR1 = 0x00;
> UMCTL1 = 0x00; // modulation
> UCTL1 &= ~SWRST; // UART1 reset released for operation
> IE2 |= URXIE1; // Enable USART0 RX interrupt
> }
>
> while(1)
> {
> while (!(IFG2 & UUTXIFG1));
> U1TXBUF = 0x11;
> for(int k=0;k<1000;k++);
>
> while (!(IFG2 & UTXIFG1));
> U1TXBUF = 0x22;
> for(int k=0;k<1000;k++);
> }
>
> #pragma vector=USART1RX_VECTOR
> __interrupt void usart1_rx (void)
> {
> while (!(IFG2 & URXIFG1));
> Rx1_Buffer = U1RXBUF;
> }
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: UART communication Baud Rate problem (F2617 <-> F448) - kshot2u - Aug 13 4:06:30 2009
--- In m...@yahoogroups.com, Microbit_Ubuntu
wrote:
>
> On Thu, 2009-08-13 at 06:32 +0000, kshot2u wrote:
> > Hi I am A Graduate school student in korea. ^^
> >
> > I want to communicate between F2617 and F448 using UART.
> >
> > F2617 SMCLK is 8MHz and F448 SMCLK is 4MHz. Baud rate is 115200Hz.
> >
> > But they have the difference in bit durations and intervals.
> >
> > Speed is not the same.
> >
> > So the result of read data was wrong.
> >
> > I think it is my mistake that setting the registers.
> >
> > How I can equalize the bit durations?
> >
> > Followings are my IAR codes.
> >
> >
> >
> > 1. F2617 code
> >
> > void SetUART1 (void)
> > {
> > UCA1CTL1 |= UCSWRST;
> >
> > UCA1CTL0 = 0; // no parity, 1 stop bits, 8-bit data
> > UCA1CTL1 = UCSSEL_3; // SMCLK
> > //UCA1MCTL = UCOS16;
> > UCA1BR1 = 0x00;
> > UCA1BR0 = 69; // 8 Mhz, 115200 bps
> > UCA1MCTL |= UCBRS_4; // 8 Mhz, 115200 bps
> >
> > UCA1CTL1 &= ~UCSWRST; // USART reset released for operation
> > UC1IE = UCA1RXIE;
> > }
> >
> > while(1)
> > {
> > while (!(IFG2&UCA1TXIFG));
> > UCA1TXBUF=0x11;
> > for(int k=0;k<1000;k++);
> >
> > while (!(IFG2&UCA1TXIFG));
> > UCA1TXBUF=0x22;
> > for(int k=0;k<1000;k++);
> > }
> >
> > #pragma vector = USCIAB1RX_VECTOR
> > __interrupt void USCIAB1_RxInterrupt (void)
> > {
> > if (UC1IFG & UCA1RXIFG)
> > Rx1_Buffer = UCA1RXBUF;
> > }
> >
> >
> >
> > 2. F448 codes
> >
> > void SetUART1 (void)
> > {
> >
> > UCTL1 |= SWRST; // set SWRST
> > ME2 |= UTXE1 | URXE1; // Enable USART1 TXD/RXD
> > UCTL1 |= CHAR; // 8-bit character
> > UTCTL1 |= SSEL1; // UCLK = SMCLK
> > U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> > U1BR1 = 0x00;
> > UMCTL1 = 0x00; // modulation
> > UCTL1 &= ~SWRST; // UART1 reset released for operation
> > IE2 |= URXIE1; // Enable USART0 RX interrupt
> > }
> >
> > while(1)
> > {
> > while (!(IFG2 & UUTXIFG1));
> > U1TXBUF = 0x11;
> > for(int k=0;k<1000;k++);
> >
> > while (!(IFG2 & UTXIFG1));
> > U1TXBUF = 0x22;
> > for(int k=0;k<1000;k++);
> > }
> >
> > #pragma vector=USART1RX_VECTOR
> > __interrupt void usart1_rx (void)
> > {
> > while (!(IFG2 & URXIFG1));
> > Rx1_Buffer = U1RXBUF;
> > }
> >
> >
> >
> > ------------------------------------
> >
> >
> >
> >

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: UART communication Baud Rate problem (F2617 <-> F448) - kshot2u - Aug 13 4:56:01 2009
Thnk you for your answer~ ^^
I rivise the F448 BR div value(0x69 -> 0x34) and modulation bit(0x00 ->
0xDD), but the result is same.
These codes problems are transmited data bit duration difference...
T,,T
Following picture, Yellow line is F2617 transmitting data, 0x55 and blue
line is F448 transmitting data, 0x55
href="http://www.mediafire.com/imageview.php?quickkey=5u2knom2l2f&thumb=\
5
" target="_blank">
src="http://www.mediafire.com/imgbnc.php/e51b5cc7d4db867cbf8f2b64c077c20\
d4g.jpg
jpg> " border="0" alt="Unlimited Free Image and File Hosting at
MediaFire">
--- In m...@yahoogroups.com, "old_cow_yellow"
wrote:
>
> (1) To fix the F448 baud, replace the lines:
>
> U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> U1BR1 = 0x00;
> UMCTL1 = 0x00; // modulation
>
> by the lines:
>
> U1BR0 = 34; // 4MHz / 115200 = 34.7
> U1BR1 = 0x00;
> UMCTL1 = 0xDD; // modulation
>
> (2) Are the two playing ping-pong? But which one starts the first
shot? Look to me they will wait for each other forever and nothing will
happen.
>
> (3) Polling for the TXRDY flag inside the RX ISR is prudent but silly.
(Ha Ha)
>
> --- In m...@yahoogroups.com, "kshot2u" kshot2u@ wrote:
> >
> > Hi I am A Graduate school student in korea. ^^
> >
> > I want to communicate between F2617 and F448 using UART.
> >
> > F2617 SMCLK is 8MHz and F448 SMCLK is 4MHz. Baud rate is 115200Hz.
> >
> > But they have the difference in bit durations and intervals.
> >
> > Speed is not the same.
> >
> > So the result of read data was wrong.
> >
> > I think it is my mistake that setting the registers.
> >
> > How I can equalize the bit durations?
> >
> > Followings are my IAR codes.
> >
> >
> >
> > 1. F2617 code
> >
> > void SetUART1 (void)
> > {
> > UCA1CTL1 |= UCSWRST;
> >
> > UCA1CTL0 = 0; // no parity, 1 stop bits, 8-bit data
> > UCA1CTL1 = UCSSEL_3; // SMCLK
> > //UCA1MCTL = UCOS16;
> > UCA1BR1 = 0x00;
> > UCA1BR0 = 69; // 8 Mhz, 115200 bps
> > UCA1MCTL |= UCBRS_4; // 8 Mhz, 115200 bps
> >
> > UCA1CTL1 &= ~UCSWRST; // USART reset released for operation
> > UC1IE = UCA1RXIE;
> > }
> >
> > while(1)
> > {
> > while (!(IFG2&UCA1TXIFG));
> > UCA1TXBUF=0x11;
> > for(int k=0;k<1000;k++);
> >
> > while (!(IFG2&UCA1TXIFG));
> > UCA1TXBUF=0x22;
> > for(int k=0;k<1000;k++);
> > }
> >
> > #pragma vector = USCIAB1RX_VECTOR
> > __interrupt void USCIAB1_RxInterrupt (void)
> > {
> > if (UC1IFG & UCA1RXIFG)
> > Rx1_Buffer = UCA1RXBUF;
> > }
> >
> >
> >
> > 2. F448 codes
> >
> > void SetUART1 (void)
> > {
> >
> > UCTL1 |= SWRST; // set SWRST
> > ME2 |= UTXE1 | URXE1; // Enable USART1 TXD/RXD
> > UCTL1 |= CHAR; // 8-bit character
> > UTCTL1 |= SSEL1; // UCLK = SMCLK
> > U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> > U1BR1 = 0x00;
> > UMCTL1 = 0x00; // modulation
> > UCTL1 &= ~SWRST; // UART1 reset released for operation
> > IE2 |= URXIE1; // Enable USART0 RX interrupt
> > }
> >
> > while(1)
> > {
> > while (!(IFG2 & UUTXIFG1));
> > U1TXBUF = 0x11;
> > for(int k=0;k<1000;k++);
> >
> > while (!(IFG2 & UTXIFG1));
> > U1TXBUF = 0x22;
> > for(int k=0;k<1000;k++);
> > }
> >
> > #pragma vector=USART1RX_VECTOR
> > __interrupt void usart1_rx (void)
> > {
> > while (!(IFG2 & URXIFG1));
> > Rx1_Buffer = U1RXBUF;
> > }
>
[Non-text portions of this message have been removed]
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: UART communication Baud Rate problem (F2617 <-> F448) - kshot2u - Aug 13 5:02:30 2009
Thnk you for your answer~ ^^
I rivise the F448 BR div value(0x69 -> 0x34) and modulation bit(0x00 ->
0xDD), but the result is same.
These codes problems are transmited data bit duration difference...
T,,T
Following picture, Yellow line is F2617 transmitting data, 0x55 and blue
line is F448 transmitting data, 0x55
[Free Image Hosting at www.ImageShack.us]
[QuickPost]
picture001ktk.jpg>
--- In m...@yahoogroups.com, "old_cow_yellow"
wrote:
>
> (1) To fix the F448 baud, replace the lines:
>
> U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> U1BR1 = 0x00;
> UMCTL1 = 0x00; // modulation
>
> by the lines:
>
> U1BR0 = 34; // 4MHz / 115200 = 34.7
> U1BR1 = 0x00;
> UMCTL1 = 0xDD; // modulation
>
> (2) Are the two playing ping-pong? But which one starts the first
shot? Look to me they will wait for each other forever and nothing will
happen.
>
> (3) Polling for the TXRDY flag inside the RX ISR is prudent but silly.
(Ha Ha)
>
> --- In m...@yahoogroups.com, "kshot2u" kshot2u@ wrote:
> >
> > Hi I am A Graduate school student in korea. ^^
> >
> > I want to communicate between F2617 and F448 using UART.
> >
> > F2617 SMCLK is 8MHz and F448 SMCLK is 4MHz. Baud rate is 115200Hz.
> >
> > But they have the difference in bit durations and intervals.
> >
> > Speed is not the same.
> >
> > So the result of read data was wrong.
> >
> > I think it is my mistake that setting the registers.
> >
> > How I can equalize the bit durations?
> >
> > Followings are my IAR codes.
> >
> >
> >
> > 1. F2617 code
> >
> > void SetUART1 (void)
> > {
> > UCA1CTL1 |= UCSWRST;
> >
> > UCA1CTL0 = 0; // no parity, 1 stop bits, 8-bit data
> > UCA1CTL1 = UCSSEL_3; // SMCLK
> > //UCA1MCTL = UCOS16;
> > UCA1BR1 = 0x00;
> > UCA1BR0 = 69; // 8 Mhz, 115200 bps
> > UCA1MCTL |= UCBRS_4; // 8 Mhz, 115200 bps
> >
> > UCA1CTL1 &= ~UCSWRST; // USART reset released for operation
> > UC1IE = UCA1RXIE;
> > }
> >
> > while(1)
> > {
> > while (!(IFG2&UCA1TXIFG));
> > UCA1TXBUF=0x11;
> > for(int k=0;k<1000;k++);
> >
> > while (!(IFG2&UCA1TXIFG));
> > UCA1TXBUF=0x22;
> > for(int k=0;k<1000;k++);
> > }
> >
> > #pragma vector = USCIAB1RX_VECTOR
> > __interrupt void USCIAB1_RxInterrupt (void)
> > {
> > if (UC1IFG & UCA1RXIFG)
> > Rx1_Buffer = UCA1RXBUF;
> > }
> >
> >
> >
> > 2. F448 codes
> >
> > void SetUART1 (void)
> > {
> >
> > UCTL1 |= SWRST; // set SWRST
> > ME2 |= UTXE1 | URXE1; // Enable USART1 TXD/RXD
> > UCTL1 |= CHAR; // 8-bit character
> > UTCTL1 |= SSEL1; // UCLK = SMCLK
> > U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> > U1BR1 = 0x00;
> > UMCTL1 = 0x00; // modulation
> > UCTL1 &= ~SWRST; // UART1 reset released for operation
> > IE2 |= URXIE1; // Enable USART0 RX interrupt
> > }
> >
> > while(1)
> > {
> > while (!(IFG2 & UUTXIFG1));
> > U1TXBUF = 0x11;
> > for(int k=0;k<1000;k++);
> >
> > while (!(IFG2 & UTXIFG1));
> > U1TXBUF = 0x22;
> > for(int k=0;k<1000;k++);
> > }
> >
> > #pragma vector=USART1RX_VECTOR
> > __interrupt void usart1_rx (void)
> > {
> > while (!(IFG2 & URXIFG1));
> > Rx1_Buffer = U1RXBUF;
> > }
>
[Non-text portions of this message have been removed]
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )MSP430F2274 with CC2480 -> Libs - Alesandro Correa - Aug 13 8:11:55 2009
I have a eZ430-RF2480 and I needed the firmware demo.
Where I find a ZigBee Sensor Monitor demo for IAR?
Looked at TI site but not found, found others examples.
tks,
Alessandro
=09
=09
=09
_________________________________________________________________
Emoticons e Winks super diferentes para o Messenger. Baixe agora, =E9 gr=E1=
tis!
http://specials.br.msn.com/ilovemessenger/pacotes.aspx
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: UART communication Baud Rate problem (F2617 <-> F448) - old_cow_yellow - Aug 13 10:20:04 2009
Please read my previous reply again. The comment says:
4MHz / 115200 = 34.7
Try to understand that:
34 is 0x22, not 0x34
0x34 is 52, not 34
--- In m...@yahoogroups.com, "kshot2u"
wrote:
> Thnk you for your answer~ ^^
>
> I rivise the F448 BR div value(0x69 -> 0x34) and modulation bit(0x00 ->
> 0xDD), but the result is same.
>
> These codes problems are transmited data bit duration difference...
>
> T,,T
>
> Following picture, Yellow line is F2617 transmitting data, 0x55 and blue
> line is F448 transmitting data, 0x55
> [Free Image Hosting at www.ImageShack.us]
> [QuickPost]
>
> picture001ktk.jpg> --- In m...@yahoogroups.com, "old_cow_yellow"
> wrote:
> >
> > (1) To fix the F448 baud, replace the lines:
> >
> > U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> > U1BR1 = 0x00;
> > UMCTL1 = 0x00; // modulation
> >
> > by the lines:
> >
> > U1BR0 = 34; // 4MHz / 115200 = 34.7
> > U1BR1 = 0x00;
> > UMCTL1 = 0xDD; // modulation
> >
> > (2) Are the two playing ping-pong? But which one starts the first
> shot? Look to me they will wait for each other forever and nothing will
> happen.
> >
> > (3) Polling for the TXRDY flag inside the RX ISR is prudent but silly.
> (Ha Ha)
> >
> > --- In m...@yahoogroups.com, "kshot2u" kshot2u@ wrote:
> > >
> > > Hi I am A Graduate school student in korea. ^^
> > >
> > > I want to communicate between F2617 and F448 using UART.
> > >
> > > F2617 SMCLK is 8MHz and F448 SMCLK is 4MHz. Baud rate is 115200Hz.
> > >
> > > But they have the difference in bit durations and intervals.
> > >
> > > Speed is not the same.
> > >
> > > So the result of read data was wrong.
> > >
> > > I think it is my mistake that setting the registers.
> > >
> > > How I can equalize the bit durations?
> > >
> > > Followings are my IAR codes.
> > >
> > >
> > >
> > > 1. F2617 code
> > >
> > > void SetUART1 (void)
> > > {
> > > UCA1CTL1 |= UCSWRST;
> > >
> > > UCA1CTL0 = 0; // no parity, 1 stop bits, 8-bit data
> > > UCA1CTL1 = UCSSEL_3; // SMCLK
> > > //UCA1MCTL = UCOS16;
> > > UCA1BR1 = 0x00;
> > > UCA1BR0 = 69; // 8 Mhz, 115200 bps
> > > UCA1MCTL |= UCBRS_4; // 8 Mhz, 115200 bps
> > >
> > > UCA1CTL1 &= ~UCSWRST; // USART reset released for operation
> > > UC1IE = UCA1RXIE;
> > > }
> > >
> > > while(1)
> > > {
> > > while (!(IFG2&UCA1TXIFG));
> > > UCA1TXBUF=0x11;
> > > for(int k=0;k<1000;k++);
> > >
> > > while (!(IFG2&UCA1TXIFG));
> > > UCA1TXBUF=0x22;
> > > for(int k=0;k<1000;k++);
> > > }
> > >
> > > #pragma vector = USCIAB1RX_VECTOR
> > > __interrupt void USCIAB1_RxInterrupt (void)
> > > {
> > > if (UC1IFG & UCA1RXIFG)
> > > Rx1_Buffer = UCA1RXBUF;
> > > }
> > >
> > >
> > >
> > > 2. F448 codes
> > >
> > > void SetUART1 (void)
> > > {
> > >
> > > UCTL1 |= SWRST; // set SWRST
> > > ME2 |= UTXE1 | URXE1; // Enable USART1 TXD/RXD
> > > UCTL1 |= CHAR; // 8-bit character
> > > UTCTL1 |= SSEL1; // UCLK = SMCLK
> > > U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> > > U1BR1 = 0x00;
> > > UMCTL1 = 0x00; // modulation
> > > UCTL1 &= ~SWRST; // UART1 reset released for operation
> > > IE2 |= URXIE1; // Enable USART0 RX interrupt
> > > }
> > >
> > > while(1)
> > > {
> > > while (!(IFG2 & UUTXIFG1));
> > > U1TXBUF = 0x11;
> > > for(int k=0;k<1000;k++);
> > >
> > > while (!(IFG2 & UTXIFG1));
> > > U1TXBUF = 0x22;
> > > for(int k=0;k<1000;k++);
> > > }
> > >
> > > #pragma vector=USART1RX_VECTOR
> > > __interrupt void usart1_rx (void)
> > > {
> > > while (!(IFG2 & URXIFG1));
> > > Rx1_Buffer = U1RXBUF;
> > > }
> > >
> >
> [Non-text portions of this message have been removed]
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: MSP430F2274 with CC2480 -> Libs - Bart Oegema - Aug 13 11:31:15 2009
Is swru169 what you're looking for, or is that the other examples you
were referring to?
http://www.ti.com/litv/zip/swru169
That was linked under Tools and Software at the bottom of the page for
the CC2480 under the name "CC2480 Software Examples".
- Bart
On Thu, Aug 13, 2009 at 5:09 AM, Alesandro Correa
wr=
ote:
> I have a eZ430-RF2480 and I needed the firmware demo.
>
> Where I find a ZigBee Sensor Monitor demo for IAR?
>
> Looked at TI site but not found, found others examples.
>
> tks,
>
> Alessandro
>
> __________________________________________________________
> Emoticons e Winks super diferentes para o Messenger. Baixe agora, =E9 gr=
=E1tis!
> http://specials.br.msn.com/ilovemessenger/pacotes.aspx
>
> [Non-text portions of this message have been removed]
>
>=20
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: UART communication Baud Rate problem (F2617 <-> F448) - kshot2u - Aug 13 12:05:14 2009
Oh...my god...
It's my mistake...
It's very small.. but it makes me so sad T.T
Thanks a lot!!
It works very well..
--- In m...@yahoogroups.com, "old_cow_yellow"
wrote:
>
> Please read my previous reply again. The comment says:
> 4MHz / 115200 = 34.7
>
> Try to understand that:
> 34 is 0x22, not 0x34
> 0x34 is 52, not 34
>
> --- In m...@yahoogroups.com, "kshot2u" wrote:
> >
> >
> > Thnk you for your answer~ ^^
> >
> > I rivise the F448 BR div value(0x69 -> 0x34) and modulation bit(0x00 ->
> > 0xDD), but the result is same.
> >
> > These codes problems are transmited data bit duration difference...
> >
> > T,,T
> >
> > Following picture, Yellow line is F2617 transmitting data, 0x55 and blue
> > line is F448 transmitting data, 0x55
> >
> >
> > [Free Image Hosting at www.ImageShack.us]
> >
> >
> > [QuickPost]
> >
> > picture001ktk.jpg>
> >
> >
> >
> > --- In m...@yahoogroups.com, "old_cow_yellow"
> > wrote:
> > >
> > > (1) To fix the F448 baud, replace the lines:
> > >
> > > U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> > > U1BR1 = 0x00;
> > > UMCTL1 = 0x00; // modulation
> > >
> > > by the lines:
> > >
> > > U1BR0 = 34; // 4MHz / 115200 = 34.7
> > > U1BR1 = 0x00;
> > > UMCTL1 = 0xDD; // modulation
> > >
> > > (2) Are the two playing ping-pong? But which one starts the first
> > shot? Look to me they will wait for each other forever and nothing will
> > happen.
> > >
> > > (3) Polling for the TXRDY flag inside the RX ISR is prudent but silly.
> > (Ha Ha)
> > >
> > > --- In m...@yahoogroups.com, "kshot2u" kshot2u@ wrote:
> > > >
> > > > Hi I am A Graduate school student in korea. ^^
> > > >
> > > > I want to communicate between F2617 and F448 using UART.
> > > >
> > > > F2617 SMCLK is 8MHz and F448 SMCLK is 4MHz. Baud rate is 115200Hz.
> > > >
> > > > But they have the difference in bit durations and intervals.
> > > >
> > > > Speed is not the same.
> > > >
> > > > So the result of read data was wrong.
> > > >
> > > > I think it is my mistake that setting the registers.
> > > >
> > > > How I can equalize the bit durations?
> > > >
> > > > Followings are my IAR codes.
> > > >
> > > >
> > > >
> > > > 1. F2617 code
> > > >
> > > > void SetUART1 (void)
> > > > {
> > > > UCA1CTL1 |= UCSWRST;
> > > >
> > > > UCA1CTL0 = 0; // no parity, 1 stop bits, 8-bit data
> > > > UCA1CTL1 = UCSSEL_3; // SMCLK
> > > > //UCA1MCTL = UCOS16;
> > > > UCA1BR1 = 0x00;
> > > > UCA1BR0 = 69; // 8 Mhz, 115200 bps
> > > > UCA1MCTL |= UCBRS_4; // 8 Mhz, 115200 bps
> > > >
> > > > UCA1CTL1 &= ~UCSWRST; // USART reset released for operation
> > > > UC1IE = UCA1RXIE;
> > > > }
> > > >
> > > > while(1)
> > > > {
> > > > while (!(IFG2&UCA1TXIFG));
> > > > UCA1TXBUF=0x11;
> > > > for(int k=0;k<1000;k++);
> > > >
> > > > while (!(IFG2&UCA1TXIFG));
> > > > UCA1TXBUF=0x22;
> > > > for(int k=0;k<1000;k++);
> > > > }
> > > >
> > > > #pragma vector = USCIAB1RX_VECTOR
> > > > __interrupt void USCIAB1_RxInterrupt (void)
> > > > {
> > > > if (UC1IFG & UCA1RXIFG)
> > > > Rx1_Buffer = UCA1RXBUF;
> > > > }
> > > >
> > > >
> > > >
> > > > 2. F448 codes
> > > >
> > > > void SetUART1 (void)
> > > > {
> > > >
> > > > UCTL1 |= SWRST; // set SWRST
> > > > ME2 |= UTXE1 | URXE1; // Enable USART1 TXD/RXD
> > > > UCTL1 |= CHAR; // 8-bit character
> > > > UTCTL1 |= SSEL1; // UCLK = SMCLK
> > > > U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> > > > U1BR1 = 0x00;
> > > > UMCTL1 = 0x00; // modulation
> > > > UCTL1 &= ~SWRST; // UART1 reset released for operation
> > > > IE2 |= URXIE1; // Enable USART0 RX interrupt
> > > > }
> > > >
> > > > while(1)
> > > > {
> > > > while (!(IFG2 & UUTXIFG1));
> > > > U1TXBUF = 0x11;
> > > > for(int k=0;k<1000;k++);
> > > >
> > > > while (!(IFG2 & UTXIFG1));
> > > > U1TXBUF = 0x22;
> > > > for(int k=0;k<1000;k++);
> > > > }
> > > >
> > > > #pragma vector=USART1RX_VECTOR
> > > > __interrupt void usart1_rx (void)
> > > > {
> > > > while (!(IFG2 & URXIFG1));
> > > > Rx1_Buffer = U1RXBUF;
> > > > }
> > > >
> > >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: UART communication Baud Rate problem (F2617 <-> F448) - Microbit_Ubuntu - Aug 13 13:30:26 2009
Well, you get there in the end :-)
But it would have helped to look closer at my first reply :
> Having a quick look at your code, one baud rate div is defined as dec
> 69 while on the other MSp430 it's 0x69. Is this a typo or misconfig ?
Anyhoo, it's fixed for you !
B rgds
Kris
On Thu, 2009-08-13 at 08:05 +0000, kshot2u wrote:
> --- In m...@yahoogroups.com, Microbit_Ubuntu
wrote:
> >
> > On Thu, 2009-08-13 at 06:32 +0000, kshot2u wrote:
> > > Hi I am A Graduate school student in korea. ^^
> > >
> > > I want to communicate between F2617 and F448 using UART.
> > >
> > > F2617 SMCLK is 8MHz and F448 SMCLK is 4MHz. Baud rate is 115200Hz.
> > >
> > > But they have the difference in bit durations and intervals.
> > >
> > > Speed is not the same.
> > >
> > > So the result of read data was wrong.
> > >
> > > I think it is my mistake that setting the registers.
> > >
> > > How I can equalize the bit durations?
> > >
> > > Followings are my IAR codes.
> > >
> > >
> > >
> > > 1. F2617 code
> > >
> > > void SetUART1 (void)
> > > {
> > > UCA1CTL1 |= UCSWRST;
> > >
> > > UCA1CTL0 = 0; // no parity, 1 stop bits, 8-bit data
> > > UCA1CTL1 = UCSSEL_3; // SMCLK
> > > //UCA1MCTL = UCOS16;
> > > UCA1BR1 = 0x00;
> > > UCA1BR0 = 69; // 8 Mhz, 115200 bps
> > > UCA1MCTL |= UCBRS_4; // 8 Mhz, 115200 bps
> > >
> > > UCA1CTL1 &= ~UCSWRST; // USART reset released for operation
> > > UC1IE = UCA1RXIE;
> > > }
> > >
> > > while(1)
> > > {
> > > while (!(IFG2&UCA1TXIFG));
> > > UCA1TXBUF=0x11;
> > > for(int k=0;k<1000;k++);
> > >
> > > while (!(IFG2&UCA1TXIFG));
> > > UCA1TXBUF=0x22;
> > > for(int k=0;k<1000;k++);
> > > }
> > >
> > > #pragma vector = USCIAB1RX_VECTOR
> > > __interrupt void USCIAB1_RxInterrupt (void)
> > > {
> > > if (UC1IFG & UCA1RXIFG)
> > > Rx1_Buffer = UCA1RXBUF;
> > > }
> > >
> > >
> > >
> > > 2. F448 codes
> > >
> > > void SetUART1 (void)
> > > {
> > >
> > > UCTL1 |= SWRST; // set SWRST
> > > ME2 |= UTXE1 | URXE1; // Enable USART1 TXD/RXD
> > > UCTL1 |= CHAR; // 8-bit character
> > > UTCTL1 |= SSEL1; // UCLK = SMCLK
> > > U1BR0 = 0x69; // 4MHz / 115200 = 34.7
> > > U1BR1 = 0x00;
> > > UMCTL1 = 0x00; // modulation
> > > UCTL1 &= ~SWRST; // UART1 reset released for operation
> > > IE2 |= URXIE1; // Enable USART0 RX interrupt
> > > }
> > >
> > > while(1)
> > > {
> > > while (!(IFG2 & UUTXIFG1));
> > > U1TXBUF = 0x11;
> > > for(int k=0;k<1000;k++);
> > >
> > > while (!(IFG2 & UTXIFG1));
> > > U1TXBUF = 0x22;
> > > for(int k=0;k<1000;k++);
> > > }
> > >
> > > #pragma vector=USART1RX_VECTOR
> > > __interrupt void usart1_rx (void)
> > > {
> > > while (!(IFG2 & URXIFG1));
> > > Rx1_Buffer = U1RXBUF;
> > > }
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > >
> > >
> > >
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )RE: MSP430F2274 with CC2480 -> Libs - Alesandro Correa - Aug 13 13:56:32 2009
Thank you bart,
I think the example is not in theses files.
See the picture attached, is the aplication in computer for measure and com=
munication with CC2480 modules.
Again, tks!
Alessandro
To: m...@yahoogroups.com
From: b...@gmail.com
Date: Thu, 13 Aug 2009 08:29:39 -0700
Subject: Re: [msp430] MSP430F2274 with CC2480 -> Libs
=20
=20=20=20=20
Is swru169 what you're looking for, or is that the other =
examples you
were referring to?
http://www.ti.com/litv/zip/swru169
That was linked under Tools and Software at the bottom of the page for
the CC2480 under the name "CC2480 Software Examples".
- Bart
On Thu, Aug 13, 2009 at 5:09 AM, Alesandro Correa
wr=
ote:
>
>
> I have a eZ430-RF2480 and I needed the firmware demo.
>
> Where I find a ZigBee Sensor Monitor demo for IAR?
>
> Looked at TI site but not found, found others examples.
>
> tks,
>
> Alessandro
>
>
>
>
>
> __________________________________________________________
> Emoticons e Winks super diferentes para o Messenger. Baixe agora, =E9 gr=
=E1tis!
> http://specials.br.msn.com/ilovemessenger/pacotes.aspx
>
> [Non-text portions of this message have been removed]
>
>=20
=20
=20=20=20=20=20=20
=20=20=20=20
=20=20=20=20
=09
=09
=09
=09
=09
=09
=09
_________________________________________________________________
Deixe suas conversas mais divertidas. Baixe agora mesmo novos emoticons. =
=C9 gr=E1tis!
http://specials.br.msn.com/ilovemessenger/pacotes.aspx
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )RE: MSP430F2274 with CC2480 -> Libs - Alesandro Correa - Aug 13 14:28:53 2009
Thank you bart,
I think the example is not in theses files.
See the link page 10 http://focus.ti.com/lit/ug/swru157c/swru157c.pdf , is =
the aplication in computer for measure and communication with CC2480 module=
s.
Again, tks!
Alessandro
=09
=09
=09
_________________________________________________________________
Deixe suas conversas mais divertidas. Baixe agora mesmo novos emoticons. =
=C9 gr=E1tis!
http://specials.br.msn.com/ilovemessenger/pacotes.aspx
[Non-text portions of this message have been removed]
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.
(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )