EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Fwd: uart problem on f1611

Started by Swapna Janugani June 16, 2008
---------- Forwarded message ----------
From: Swapna Janugani
Date: Jun 16, 2008 2:13 PM
Subject: uart problem on f1611
To: o...@yahoo.com

Hi,

I am using MSP430F1611 and FT232BM connected to the MSPs UART. I am trying
to perform serial communication through usb port to MSP. I am using
hyperterminal for tx and rx.working in IAR IDE.
Here's the code for echoing character. It doesn't work. Can you please help
me out figuring out whats wrong with it.

#include "io430.h"

int main( void )
{
// Stop watchdog timer
to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
// Enable module
ME1 |= (UTXE0); // Reset UART

U0CTL = (CHAR);
U0TCTL = (TXEPT);//+UTCTL_ACLK); // Setup 2400 baud with ACLK

U0BR0 = 0x45; // 8 mhz 115200bps//
U0BR1 = 0x00;
U0MCTL = 0xAA;

IFG1 |= (UTXIFG0); // Set Tx Flag

P3SEL |= 0x30; // Enable module pin functions
P3DIR |= 0x30;

ME1 |= UTXE0 + URXE0; // Enable module

U0RCTL = (URXEIE); // Reset UART
IE1 |= (URXIE0);

}

#pragma vector=UART0RX_VECTOR
__interrupt void UART0RX (void)
{
TXBUF0 = RXBUF0;
}
Thank you very much for your help!!!

Thanks,
Sans.

Beginning Microcontrollers with the MSP430

The code you posted last week was almost entirely correct. Your new
code is almost entirely wrong.

What do you mean by "working in IAR IDE"?

Did you get the crystal to oscillate?

Did you try the loop-back by shorting pin #32 and #33? (With the
modified P3 settings.)

I think you have hardware problems. Trying random incorrect software
cannot solve hardware problems.

--- In m..., "Swapna Janugani" wrote:
>
> ---------- Forwarded message ----------
> From: Swapna Janugani
> Date: Jun 16, 2008 2:13 PM
> Subject: uart problem on f1611
> To: old_cow_yellow@...
>
> Hi,
>
> I am using MSP430F1611 and FT232BM connected to the MSPs UART. I am
trying
> to perform serial communication through usb port to MSP. I am using
> hyperterminal for tx and rx.working in IAR IDE.
> Here's the code for echoing character. It doesn't work. Can you
please help
> me out figuring out whats wrong with it.
>
> #include "io430.h"
>
> int main( void )
> {
> // Stop
watchdog timer
> to prevent time out reset
> WDTCTL = WDTPW + WDTHOLD;
> // Enable module
> ME1 |= (UTXE0); // Reset UART
>
> U0CTL = (CHAR);
> U0TCTL = (TXEPT);//+UTCTL_ACLK); // Setup 2400 baud with ACLK
>
> U0BR0 = 0x45; // 8 mhz 115200bps//
> U0BR1 = 0x00;
> U0MCTL = 0xAA;
>
> IFG1 |= (UTXIFG0); // Set Tx Flag
>
> P3SEL |= 0x30; // Enable module pin functions
> P3DIR |= 0x30;
>
> ME1 |= UTXE0 + URXE0; // Enable module
>
> U0RCTL = (URXEIE); // Reset UART
> IE1 |= (URXIE0);
>
> }
>
> #pragma vector=UART0RX_VECTOR
> __interrupt void UART0RX (void)
> {
> TXBUF0 = RXBUF0;
> }
> Thank you very much for your help!!!
>
> Thanks,
> Sans.
>
>

It's the IAR embedded work bench I am working on. I tried shorting those two
pins and checked for the signal. I couldnt see any. Can I conclude its the
hardware problem?

On 6/16/08, old_cow_yellow wrote:
>
> The code you posted last week was almost entirely correct. Your new
> code is almost entirely wrong.
>
> What do you mean by "working in IAR IDE"?
>
> Did you get the crystal to oscillate?
>
> Did you try the loop-back by shorting pin #32 and #33? (With the
> modified P3 settings.)
>
> I think you have hardware problems. Trying random incorrect software
> cannot solve hardware problems.
>
> --- In m... , "Swapna
> Janugani" wrote:
> >
> > ---------- Forwarded message ----------
> > From: Swapna Janugani
> > Date: Jun 16, 2008 2:13 PM
> > Subject: uart problem on f1611
> > To: old_cow_yellow@...
> >
> > Hi,
> >
> > I am using MSP430F1611 and FT232BM connected to the MSPs UART. I am
> trying
> > to perform serial communication through usb port to MSP. I am using
> > hyperterminal for tx and rx.working in IAR IDE.
> > Here's the code for echoing character. It doesn't work. Can you
> please help
> > me out figuring out whats wrong with it.
> >
> > #include "io430.h"
> >
> > int main( void )
> > {
> > // Stop
> watchdog timer
> > to prevent time out reset
> > WDTCTL = WDTPW + WDTHOLD;
> > // Enable module
> > ME1 |= (UTXE0); // Reset UART
> >
> > U0CTL = (CHAR);
> > U0TCTL = (TXEPT);//+UTCTL_ACLK); // Setup 2400 baud with ACLK
> >
> > U0BR0 = 0x45; // 8 mhz 115200bps//
> > U0BR1 = 0x00;
> > U0MCTL = 0xAA;
> >
> > IFG1 |= (UTXIFG0); // Set Tx Flag
> >
> > P3SEL |= 0x30; // Enable module pin functions
> > P3DIR |= 0x30;
> >
> > ME1 |= UTXE0 + URXE0; // Enable module
> >
> > U0RCTL = (URXEIE); // Reset UART
> > IE1 |= (URXIE0);
> >
> > }
> >
> > #pragma vector=UART0RX_VECTOR
> > __interrupt void UART0RX (void)
> > {
> > TXBUF0 = RXBUF0;
> > }
> > Thank you very much for your help!!!
> >
> > Thanks,
> > Sans.
> >
> >
> >
>


Hyperterminal is designed to emulate a Terminal and to communicate
with other equipment through a COM Port (or Modem). When you type a
character on the keyboard, the ASCII code of that key is sent to the
TXD pin of the COM Port. When the ASCII code from the other equipment
is sent to the RXD pin of the COM Port, a character shows up on the
screen.

But you are not using a real COM Port. You are using a FT232BM that
disguises itself as a COM Port. In order to do so, you need to load an
USB Driver from FDTI. If you have successfully installed the driver,
your Hardware Manager on the PC should show that there is now a
previously non-existing COM Port (with a new physically non-existing
port number). When you start Hyperterminal, you have to tell it to use
this new COM Port (the COM Port that in reality is the FT323BM chip on
the USB).

When all the above are done correctly, the key code you type will come
out the TXD pin of the FT232BM chip and any code injected into the RXD
pin of the FT232BM will show up on the screen. Thus if you short those
two pins, what you type will go a round trip and show up on the
screen. But those two pins of the FT232BM chip are already connected
to pin #32 and #33 of the MSP430F1611 chip. The reason I told you to
change the settings of P3 is so that the MSP430F1611 will leave the
signals on those two pins alone; not to interfere with it's round trip
journey. What ever you do with the rest of the MSP430F1611 program are
totally irrelevant. The purpose of this test is to see if
Hyperterminal, the Virtual COM Port and the FT232BM chip are set up
correctly and can transport data to and from pin #32 and #33 of the
MSP430F1611

You said there is no echo back. That means you failed to bring the key
code to pin #33 or failed to bring the signal from pin #32 back to the
screen. I do not know it is hardware problem, set-up problem,
operating procedure problem, or what. It has nothing to do with the
program with MSP430F1611.

You also said the signal looks strange. I do not know what that means.
May be you do not have a common ground? But no matter what, changing
the MSP430F1611 program will not correct the problem.

You did not say anything about crystal oscillator. If that still does
not work, you cannot generate an accurate baud rate for the UART.

--- In m..., "Swapna Janugani" wrote:
>
> It's the IAR embedded work bench I am working on. I tried shorting
those two
> pins and checked for the signal. I couldnt see any. Can I conclude
its the
> hardware problem?
>
> On 6/16/08, old_cow_yellow wrote:
> >
> > The code you posted last week was almost entirely correct. Your new
> > code is almost entirely wrong.
> >
> > What do you mean by "working in IAR IDE"?
> >
> > Did you get the crystal to oscillate?
> >
> > Did you try the loop-back by shorting pin #32 and #33? (With the
> > modified P3 settings.)
> >
> > I think you have hardware problems. Trying random incorrect software
> > cannot solve hardware problems.
> >
> > --- In m... , "Swapna
> > Janugani" wrote:
> > >
> > > ---------- Forwarded message ----------
> > > From: Swapna Janugani
> > > Date: Jun 16, 2008 2:13 PM
> > > Subject: uart problem on f1611
> > > To: old_cow_yellow@
> > >
> > > Hi,
> > >
> > > I am using MSP430F1611 and FT232BM connected to the MSPs UART. I am
> > trying
> > > to perform serial communication through usb port to MSP. I am using
> > > hyperterminal for tx and rx.working in IAR IDE.
> > > Here's the code for echoing character. It doesn't work. Can you
> > please help
> > > me out figuring out whats wrong with it.
> > >
> > > #include "io430.h"
> > >
> > > int main( void )
> > > {
> > > // Stop
> > watchdog timer
> > > to prevent time out reset
> > > WDTCTL = WDTPW + WDTHOLD;
> > > // Enable module
> > > ME1 |= (UTXE0); // Reset UART
> > >
> > > U0CTL = (CHAR);
> > > U0TCTL = (TXEPT);//+UTCTL_ACLK); // Setup 2400 baud with ACLK
> > >
> > > U0BR0 = 0x45; // 8 mhz 115200bps//
> > > U0BR1 = 0x00;
> > > U0MCTL = 0xAA;
> > >
> > > IFG1 |= (UTXIFG0); // Set Tx Flag
> > >
> > > P3SEL |= 0x30; // Enable module pin functions
> > > P3DIR |= 0x30;
> > >
> > > ME1 |= UTXE0 + URXE0; // Enable module
> > >
> > > U0RCTL = (URXEIE); // Reset UART
> > > IE1 |= (URXIE0);
> > >
> > > }
> > >
> > > #pragma vector=UART0RX_VECTOR
> > > __interrupt void UART0RX (void)
> > > {
> > > TXBUF0 = RXBUF0;
> > > }
> > > Thank you very much for your help!!!
> > >
> > > Thanks,
> > > Sans.
> > >
> > >
> > >
> > >
> >
> >
> >
>
>

This works fine.

#include

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P3SEL |= 0x30; // P3.4,5 = USART0 TXD/RXD
P3DIR |= 0x10;

BCSCTL1 &= ~XT2OFF; // XT2on

do
{
IFG1&= ~OFIFG; // Clear OSCFault flag
__delay_cycles(256);
} while (IFG1 & OFIFG); // OSCFault flag still set?

BCSCTL2 |= SELM_2 + SELS; // MCLK = SMCLK = XT2 (safe)
ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD
UCTL0 |= CHAR; // 8-bit character
UTCTL0 |= SSEL1; // UCLK = SMCLK
UBR00 = 0x45; // 8MHz 115200
UBR10 = 0x00; // 8MHz 115200
UMCTL0 = 0xAA; // 8MHz 115200 modulation
UCTL0 &= ~SWRST; // Initialize USART state machine
IE1 |= URXIE0; // Enable USART0 RX interrupt

_BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/ interrupt
}

#pragma vector=USART0RX_VECTOR
__interrupt void usart0_rx (void)
{
while (!(IFG1 & UTXIFG0)); // USART0 TX buffer ready?
TXBUF0 = RXBUF0; // RXBUF0 to TXBUF0
}

--- In m..., "old_cow_yellow"
wrote:
>
> Hyperterminal is designed to emulate a Terminal and to communicate
> with other equipment through a COM Port (or Modem). When you type a
> character on the keyboard, the ASCII code of that key is sent to the
> TXD pin of the COM Port. When the ASCII code from the other equipment
> is sent to the RXD pin of the COM Port, a character shows up on the
> screen.
>
> But you are not using a real COM Port. You are using a FT232BM that
> disguises itself as a COM Port. In order to do so, you need to load an
> USB Driver from FDTI. If you have successfully installed the driver,
> your Hardware Manager on the PC should show that there is now a
> previously non-existing COM Port (with a new physically non-existing
> port number). When you start Hyperterminal, you have to tell it to use
> this new COM Port (the COM Port that in reality is the FT323BM chip on
> the USB).
>
> When all the above are done correctly, the key code you type will come
> out the TXD pin of the FT232BM chip and any code injected into the RXD
> pin of the FT232BM will show up on the screen. Thus if you short those
> two pins, what you type will go a round trip and show up on the
> screen. But those two pins of the FT232BM chip are already connected
> to pin #32 and #33 of the MSP430F1611 chip. The reason I told you to
> change the settings of P3 is so that the MSP430F1611 will leave the
> signals on those two pins alone; not to interfere with it's round trip
> journey. What ever you do with the rest of the MSP430F1611 program are
> totally irrelevant. The purpose of this test is to see if
> Hyperterminal, the Virtual COM Port and the FT232BM chip are set up
> correctly and can transport data to and from pin #32 and #33 of the
> MSP430F1611
>
> You said there is no echo back. That means you failed to bring the key
> code to pin #33 or failed to bring the signal from pin #32 back to the
> screen. I do not know it is hardware problem, set-up problem,
> operating procedure problem, or what. It has nothing to do with the
> program with MSP430F1611.
>
> You also said the signal looks strange. I do not know what that means.
> May be you do not have a common ground? But no matter what, changing
> the MSP430F1611 program will not correct the problem.
>
> You did not say anything about crystal oscillator. If that still does
> not work, you cannot generate an accurate baud rate for the UART.
>
> --- In m..., "Swapna Janugani" wrote:
> >
> > It's the IAR embedded work bench I am working on. I tried shorting
> those two
> > pins and checked for the signal. I couldnt see any. Can I conclude
> its the
> > hardware problem?
> >
> > On 6/16/08, old_cow_yellow wrote:
> > >
> > > The code you posted last week was almost entirely correct.
Your new
> > > code is almost entirely wrong.
> > >
> > > What do you mean by "working in IAR IDE"?
> > >
> > > Did you get the crystal to oscillate?
> > >
> > > Did you try the loop-back by shorting pin #32 and #33? (With the
> > > modified P3 settings.)
> > >
> > > I think you have hardware problems. Trying random incorrect software
> > > cannot solve hardware problems.
> > >
> > > --- In m... , "Swapna
> > > Janugani" wrote:
> > > >
> > > > ---------- Forwarded message ----------
> > > > From: Swapna Janugani
> > > > Date: Jun 16, 2008 2:13 PM
> > > > Subject: uart problem on f1611
> > > > To: old_cow_yellow@
> > > >
> > > > Hi,
> > > >
> > > > I am using MSP430F1611 and FT232BM connected to the MSPs UART.
I am
> > > trying
> > > > to perform serial communication through usb port to MSP. I am
using
> > > > hyperterminal for tx and rx.working in IAR IDE.
> > > > Here's the code for echoing character. It doesn't work. Can you
> > > please help
> > > > me out figuring out whats wrong with it.
> > > >
> > > > #include "io430.h"
> > > >
> > > > int main( void )
> > > > {
> > > > // Stop
> > > watchdog timer
> > > > to prevent time out reset
> > > > WDTCTL = WDTPW + WDTHOLD;
> > > > // Enable module
> > > > ME1 |= (UTXE0); // Reset UART
> > > >
> > > > U0CTL = (CHAR);
> > > > U0TCTL = (TXEPT);//+UTCTL_ACLK); // Setup 2400 baud with ACLK
> > > >
> > > > U0BR0 = 0x45; // 8 mhz 115200bps//
> > > > U0BR1 = 0x00;
> > > > U0MCTL = 0xAA;
> > > >
> > > > IFG1 |= (UTXIFG0); // Set Tx Flag
> > > >
> > > > P3SEL |= 0x30; // Enable module pin functions
> > > > P3DIR |= 0x30;
> > > >
> > > > ME1 |= UTXE0 + URXE0; // Enable module
> > > >
> > > > U0RCTL = (URXEIE); // Reset UART
> > > > IE1 |= (URXIE0);
> > > >
> > > > }
> > > >
> > > > #pragma vector=UART0RX_VECTOR
> > > > __interrupt void UART0RX (void)
> > > > {
> > > > TXBUF0 = RXBUF0;
> > > > }
> > > > Thank you very much for your help!!!
> > > >
> > > > Thanks,
> > > > Sans.
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> >
>
Got it..The problem was with the ftdi driver.

Thank you very very much!!!

S.
On 6/17/08, old_cow_yellow wrote:
>
> Hyperterminal is designed to emulate a Terminal and to communicate
> with other equipment through a COM Port (or Modem). When you type a
> character on the keyboard, the ASCII code of that key is sent to the
> TXD pin of the COM Port. When the ASCII code from the other equipment
> is sent to the RXD pin of the COM Port, a character shows up on the
> screen.
>
> But you are not using a real COM Port. You are using a FT232BM that
> disguises itself as a COM Port. In order to do so, you need to load an
> USB Driver from FDTI. If you have successfully installed the driver,
> your Hardware Manager on the PC should show that there is now a
> previously non-existing COM Port (with a new physically non-existing
> port number). When you start Hyperterminal, you have to tell it to use
> this new COM Port (the COM Port that in reality is the FT323BM chip on
> the USB).
>
> When all the above are done correctly, the key code you type will come
> out the TXD pin of the FT232BM chip and any code injected into the RXD
> pin of the FT232BM will show up on the screen. Thus if you short those
> two pins, what you type will go a round trip and show up on the
> screen. But those two pins of the FT232BM chip are already connected
> to pin #32 and #33 of the MSP430F1611 chip. The reason I told you to
> change the settings of P3 is so that the MSP430F1611 will leave the
> signals on those two pins alone; not to interfere with it's round trip
> journey. What ever you do with the rest of the MSP430F1611 program are
> totally irrelevant. The purpose of this test is to see if
> Hyperterminal, the Virtual COM Port and the FT232BM chip are set up
> correctly and can transport data to and from pin #32 and #33 of the
> MSP430F1611
>
> You said there is no echo back. That means you failed to bring the key
> code to pin #33 or failed to bring the signal from pin #32 back to the
> screen. I do not know it is hardware problem, set-up problem,
> operating procedure problem, or what. It has nothing to do with the
> program with MSP430F1611.
>
> You also said the signal looks strange. I do not know what that means.
> May be you do not have a common ground? But no matter what, changing
> the MSP430F1611 program will not correct the problem.
>
> You did not say anything about crystal oscillator. If that still does
> not work, you cannot generate an accurate baud rate for the UART.
>
> --- In m... , "Swapna
> Janugani" wrote:
> >
> > It's the IAR embedded work bench I am working on. I tried shorting
> those two
> > pins and checked for the signal. I couldnt see any. Can I conclude
> its the
> > hardware problem?
> >
> > On 6/16/08, old_cow_yellow wrote:
> > >
> > > The code you posted last week was almost entirely correct. Your new
> > > code is almost entirely wrong.
> > >
> > > What do you mean by "working in IAR IDE"?
> > >
> > > Did you get the crystal to oscillate?
> > >
> > > Did you try the loop-back by shorting pin #32 and #33? (With the
> > > modified P3 settings.)
> > >
> > > I think you have hardware problems. Trying random incorrect software
> > > cannot solve hardware problems.
> > >
> > > --- In m... > 40yahoogroups.com>, "Swapna
> > > Janugani" wrote:
> > > >
> > > > ---------- Forwarded message ----------
> > > > From: Swapna Janugani
> > > > Date: Jun 16, 2008 2:13 PM
> > > > Subject: uart problem on f1611
> > > > To: old_cow_yellow@
> > > >
> > > > Hi,
> > > >
> > > > I am using MSP430F1611 and FT232BM connected to the MSPs UART. I am
> > > trying
> > > > to perform serial communication through usb port to MSP. I am using
> > > > hyperterminal for tx and rx.working in IAR IDE.
> > > > Here's the code for echoing character. It doesn't work. Can you
> > > please help
> > > > me out figuring out whats wrong with it.
> > > >
> > > > #include "io430.h"
> > > >
> > > > int main( void )
> > > > {
> > > > // Stop
> > > watchdog timer
> > > > to prevent time out reset
> > > > WDTCTL = WDTPW + WDTHOLD;
> > > > // Enable module
> > > > ME1 |= (UTXE0); // Reset UART
> > > >
> > > > U0CTL = (CHAR);
> > > > U0TCTL = (TXEPT);//+UTCTL_ACLK); // Setup 2400 baud with ACLK
> > > >
> > > > U0BR0 = 0x45; // 8 mhz 115200bps//
> > > > U0BR1 = 0x00;
> > > > U0MCTL = 0xAA;
> > > >
> > > > IFG1 |= (UTXIFG0); // Set Tx Flag
> > > >
> > > > P3SEL |= 0x30; // Enable module pin functions
> > > > P3DIR |= 0x30;
> > > >
> > > > ME1 |= UTXE0 + URXE0; // Enable module
> > > >
> > > > U0RCTL = (URXEIE); // Reset UART
> > > > IE1 |= (URXIE0);
> > > >
> > > > }
> > > >
> > > > #pragma vector=UART0RX_VECTOR
> > > > __interrupt void UART0RX (void)
> > > > {
> > > > TXBUF0 = RXBUF0;
> > > > }
> > > > Thank you very much for your help!!!
> > > >
> > > > Thanks,
> > > > Sans.
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> >
>



The 2024 Embedded Online Conference