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.
terminal I/O on msp430F2417 - rupesh vishwakarma - Aug 12 1:15:34 2009
Hi,
I want just a simple programm which will take input from hyperterminal and =
print the same on hyperterminal ,
I can print the characters easly by the following code
void kputchar(char TXchar)
{=A0=A0=20
=A0
=A0 while(!(IFG2 & UCA0TXIFG))
=A0=A0=A0=A0=A0=A0 {
=A0=A0=A0=A0=A0=A0=A0=A0=20
=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0=A0=A0=A0=A0=A0=A0=20
=A0// wait for TX register to be empty //
=A0=A0=A0 UCA0TXBUF =3D TXchar;=A0
}=A0
it prints the characters on terminal
what should I do to get characters from hyper terminal just like scanf or g=
etchar to get characters from hyperterminal I tried to enable rx interrupt =
by
void UARTset(void) //Uses USCI_A0
{
=A0 P3SEL |=3D BIT4 + BIT5;=A0/* P3.4, P3.5 UART mode */
=A0 P3DIR |=3D BIT4;=A0=A0=A0/* P3.4 - output */
=A0 UCA0CTL1 |=3D UCSWRST;=A0=A0=A0/* disable UART */ //Universal serial co=
mmunication interface reset)
=A0 UCA0CTL0 =3D 0x00;
=A0 UCA0CTL1 |=3D UCSSEL_2;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0 // SMCLK
=A0 UCA0BR0 =3D 0xA;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 // 115200//1.1MHZ
=A0 UCA0BR1 =3D BAUD1;
=A0 UCA0MCTL =3D 0;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 // Modulation UCBRSx =3D 5
=A0UCA0CTL1 &=3D ~UCSWRST;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0 // **Initialize USCI state machine**
=A0 IE2 |=3D UCA0RXIE;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 // Enable USCI_A0 RX interrupt
=A0
=A0__bis_SR_register(GIE);=A0=A0=A0=A0=A0=A0 // Enter LPM0, interrupts enab=
led
=A0}
but the code never goes to RX interrupt handler=20
#pragma vector =3D USCIAB0RX_VECTOR
__interrupt void RXhandler (void)
{
=A0=A0=A0=A0=A0 if (IFG2 & UCA0RXIFG)
=A0=A0 {
=A0=A0=A0=A0=A0=A0 char rx=3DUCA0RXBUF;
=A0=A0 kputchar(rx);
=A0=A0=20
=A0=A0 }
code even does not jumps to rx handler so how can I get characters from ter=
minal??
rupesh IITkanpur
See the Web's breaking stories, chosen by people like you. Check =
out Yahoo! Buzz. http://in.buzz..yahoo.com/
[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: terminal I/O on msp430F2417 - Bart Oegema - Aug 12 12:20:39 2009
Rupesh,
Why are you starting multiple threads with the same question, and even
attempting to hijack other threads? Why should anyone take the time to
help you if you don't respond to the help?
With your additional emails, you still do not include the MSP430
device you are using in your design. Please include that when starting
a thread with a new question. A lot of expertise found in this group
is applicable across the entire MSP430 family, but some is more
specific to particular devices.
The fact that your kputchar(char) routine works suggests that your
UART is configured correctly, at least as far as baud rate and
modulation is concerned. It doesn't, however, use interrupts, so that
suggests that there is something wrong with how you're handling
interrupts. Following that train of thought, I notice that it seems
that the interrupt vector you've included is not the ISR corresponding
to the USCI interface (USCI_A0) you use in kputchar(char) or the RX
interrupt you enable in UART_set( ). Do you have another ISR that you
haven't included in this email, or is that the problem?
- Bart
On Tue, Aug 11, 2009 at 9:46 PM, rupesh
vishwakarma
wrote:
> Hi,
> I want just a simple programm which will take input from hyperterminal an=
d
> print the same on hyperterminal ,
> I can print the characters easly by the following code
>
> void kputchar(char TXchar)
> {
>
> =A0 while(!(IFG2 & UCA0TXIFG))
> =A0=A0=A0=A0=A0=A0 {
>
> =A0=A0=A0=A0=A0=A0=A0 }
>
> =A0// wait for TX register to be empty //
> =A0=A0=A0 UCA0TXBUF =3D TXchar;
> }
>
> it prints the characters on terminal
>
> what should I do to get characters from hyper terminal just like scanf or
> getchar to get characters from hyperterminal I tried to enable rx interru=
pt
> by
>
> void UARTset(void) //Uses USCI_A0
> {
> =A0 P3SEL |=3D BIT4 + BIT5;=A0/* P3.4, P3.5 UART mode */
> =A0 P3DIR |=3D BIT4;=A0=A0=A0/* P3.4 - output */
> =A0 UCA0CTL1 |=3D UCSWRST;=A0=A0=A0/* disable UART */ //Universal serial =
communication
> interface reset)
> =A0 UCA0CTL0 =3D 0x00;
> =A0 UCA0CTL1 |=3D UCSSEL_2;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0 // SMCLK
> =A0 UCA0BR0 =3D 0xA;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 // 115200//1.1MHZ
> =A0 UCA0BR1 =3D BAUD1;
> =A0 UCA0MCTL =3D 0;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 // Modulation UCBRSx =3D 5
> =A0UCA0CTL1 &=3D ~UCSWRST;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0 // **Initialize USCI state
> machine**
> =A0 IE2 |=3D UCA0RXIE;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 // Enable USCI_A0 RX interrupt
>
> =A0__bis_SR_register(GIE);=A0=A0=A0=A0=A0=A0 // Enter LPM0, interrupts en=
abled
> =A0}
>
> but the code never goes to RX interrupt handler
>
> #pragma vector =3D USCIAB0RX_VECTOR
> __interrupt void RXhandler (void)
> {
> =A0=A0=A0=A0=A0 if (IFG2 & UCA0RXIFG)
> =A0=A0 {
> =A0=A0=A0=A0=A0=A0 char rx=3DUCA0RXBUF;
> =A0=A0 kputchar(rx);
>
> =A0=A0 }
>
> code even does not jumps to rx handler so how can I get characters from
> terminal??
>
> rupesh IITkanpur
>
> See the Web's breaking stories, chosen by people like you. Check out
> Yahoo! Buzz. http://in.buzz..yahoo.com/
>
> [Non-text portions of this message have been removed]
>
>=20
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: terminal I/O on msp430F2417 - old_cow_yellow - Aug 12 13:49:55 2009
Bart,
He did say F2427 in the "subject"
Rupesh,
http://www.ti.com/lit/zip/slac151
has 4 examples
msp430x261x_uscia0_uart_01.c
msp430x261x_uscia0_uart_02.c
msp430x261x_uscia0_uart_03.c
msp430x261x_uscia0_uart_04.c
--OCY
--- In m...@yahoogroups.com, Bart Oegema
wrote:
>
> Rupesh,
>=20
> Why are you starting multiple threads with the same question, and even
> attempting to hijack other threads? Why should anyone take the time to
> help you if you don't respond to the help?
>=20
> With your additional emails, you still do not include the MSP430
> device you are using in your design. Please include that when starting
> a thread with a new question. A lot of expertise found in this group
> is applicable across the entire MSP430 family, but some is more
> specific to particular devices.
>=20
> The fact that your kputchar(char) routine works suggests that your
> UART is configured correctly, at least as far as baud rate and
> modulation is concerned. It doesn't, however, use interrupts, so that
> suggests that there is something wrong with how you're handling
> interrupts. Following that train of thought, I notice that it seems
> that the interrupt vector you've included is not the ISR corresponding
> to the USCI interface (USCI_A0) you use in kputchar(char) or the RX
> interrupt you enable in UART_set( ). Do you have another ISR that you
> haven't included in this email, or is that the problem?
>=20
> - Bart
>=20
>=20
>=20
> On Tue, Aug 11, 2009 at 9:46 PM, rupesh
> vishwakarma wrote:
> >
> >
> > Hi,
> > I want just a simple programm which will take input from hyperterminal =
and
> > print the same on hyperterminal ,
> > I can print the characters easly by the following code
> >
> > void kputchar(char TXchar)
> > {
> >
> > =A0 while(!(IFG2 & UCA0TXIFG))
> > =A0=A0=A0=A0=A0=A0 {
> >
> > =A0=A0=A0=A0=A0=A0=A0 }
> >
> > =A0// wait for TX register to be empty //
> > =A0=A0=A0 UCA0TXBUF =3D TXchar;
> > }
> >
> > it prints the characters on terminal
> >
> > what should I do to get characters from hyper terminal just like scanf =
or
> > getchar to get characters from hyperterminal I tried to enable rx inter=
rupt
> > by
> >
> > void UARTset(void) //Uses USCI_A0
> > {
> > =A0 P3SEL |=3D BIT4 + BIT5;=A0/* P3.4, P3.5 UART mode */
> > =A0 P3DIR |=3D BIT4;=A0=A0=A0/* P3.4 - output */
> > =A0 UCA0CTL1 |=3D UCSWRST;=A0=A0=A0/* disable UART */ //Universal seria=
l communication
> > interface reset)
> > =A0 UCA0CTL0 =3D 0x00;
> > =A0 UCA0CTL1 |=3D UCSSEL_2;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 // SMCLK
> > =A0 UCA0BR0 =3D 0xA;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 // 115200//1.1MHZ
> > =A0 UCA0BR1 =3D BAUD1;
> > =A0 UCA0MCTL =3D 0;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0 // Modulation UCBRSx =3D 5
> > =A0UCA0CTL1 &=3D ~UCSWRST;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0 // **Initialize USCI state
> > machine**
> > =A0 IE2 |=3D UCA0RXIE;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0 // Enable USCI_A0 RX interrupt
> >
> > =A0__bis_SR_register(GIE);=A0=A0=A0=A0=A0=A0 // Enter LPM0, interrupts =
enabled
> > =A0}
> >
> > but the code never goes to RX interrupt handler
> >
> > #pragma vector =3D USCIAB0RX_VECTOR
> > __interrupt void RXhandler (void)
> > {
> > =A0=A0=A0=A0=A0 if (IFG2 & UCA0RXIFG)
> > =A0=A0 {
> > =A0=A0=A0=A0=A0=A0 char rx=3DUCA0RXBUF;
> > =A0=A0 kputchar(rx);
> >
> > =A0=A0 }
> >
> > code even does not jumps to rx handler so how can I get characters from
> > terminal??
> >
> > rupesh IITkanpur
> >
> > See the Web's breaking stories, chosen by people like you. Check ou=
t
> > Yahoo! Buzz. http://in.buzz..yahoo.com/
> >
> > [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: terminal I/O on msp430F2417 - Bart Oegema - Aug 12 14:08:32 2009
Oops. Thanks, OCY. My apologies, Rupesh. Good luck on your
troubleshooting. Let us know when you figure out what was going wrong.
- Bart
On Wed, Aug 12, 2009 at 10:47 AM,
old_cow_yellow
wrote:
> Bart,
> He did say F2427 in the "subject"
>
> Rupesh,
>
> http://www.ti.com/lit/zip/slac151
> has 4 examples
> msp430x261x_uscia0_uart_01.c
> msp430x261x_uscia0_uart_02.c
> msp430x261x_uscia0_uart_03.c
> msp430x261x_uscia0_uart_04.c
>
> --OCY
>
> --- In m...@yahoogroups.com, Bart Oegema wrote:
>>
>> Rupesh,
>>
>> Why are you starting multiple threads with the same question, and even
>> attempting to hijack other threads? Why should anyone take the time to
>> help you if you don't respond to the help?
>>
>> With your additional emails, you still do not include the MSP430
>> device you are using in your design. Please include that when starting
>> a thread with a new question. A lot of expertise found in this group
>> is applicable across the entire MSP430 family, but some is more
>> specific to particular devices.
>>
>> The fact that your kputchar(char) routine works suggests that your
>> UART is configured correctly, at least as far as baud rate and
>> modulation is concerned. It doesn't, however, use interrupts, so that
>> suggests that there is something wrong with how you're handling
>> interrupts. Following that train of thought, I notice that it seems
>> that the interrupt vector you've included is not the ISR corresponding
>> to the USCI interface (USCI_A0) you use in kputchar(char) or the RX
>> interrupt you enable in UART_set( ). Do you have another ISR that you
>> haven't included in this email, or is that the problem?
>>
>> - Bart
>>
>> On Tue, Aug 11, 2009 at 9:46 PM, rupesh
>> vishwakarma wrote:
>> >
>> >
>> > Hi,
>> > I want just a simple programm which will take input from hyperterminal
>> > and
>> > print the same on hyperterminal ,
>> > I can print the characters easly by the following code
>> >
>> > void kputchar(char TXchar)
>> > {
>> >
>> > =A0 while(!(IFG2 & UCA0TXIFG))
>> > =A0=A0=A0=A0=A0=A0 {
>> >
>> > =A0=A0=A0=A0=A0=A0=A0 }
>> >
>> > =A0// wait for TX register to be empty //
>> > =A0=A0=A0 UCA0TXBUF =3D TXchar;
>> > }
>> >
>> > it prints the characters on terminal
>> >
>> > what should I do to get characters from hyper terminal just like scanf
>> > or
>> > getchar to get characters from hyperterminal I tried to enable rx
>> > interrupt
>> > by
>> >
>> > void UARTset(void) //Uses USCI_A0
>> > {
>> > =A0 P3SEL |=3D BIT4 + BIT5;=A0/* P3.4, P3.5 UART mode */
>> > =A0 P3DIR |=3D BIT4;=A0=A0=A0/* P3.4 - output */
>> > =A0 UCA0CTL1 |=3D UCSWRST;=A0=A0=A0/* disable UART */ //Universal seri=
al
>> > communication
>> > interface reset)
>> > =A0 UCA0CTL0 =3D 0x00;
>> > =A0 UCA0CTL1 |=3D UCSSEL_2;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 // SMCLK
>> > =A0 UCA0BR0 =3D 0xA;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 // 115200//1.1MHZ
>> > =A0 UCA0BR1 =3D BAUD1;
>> > =A0 UCA0MCTL =3D 0;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0 // Modulation UCBRSx =3D 5
>> > =A0UCA0CTL1 &=3D ~UCSWRST;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 // **Initialize USCI state
>> > machine**
>> > =A0 IE2 |=3D UCA0RXIE;=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0 // Enable USCI_A0 RX
>> > interrupt
>> >
>> > =A0__bis_SR_register(GIE);=A0=A0=A0=A0=A0=A0 // Enter LPM0, interrupts=
enabled
>> > =A0}
>> >
>> > but the code never goes to RX interrupt handler
>> >
>> > #pragma vector =3D USCIAB0RX_VECTOR
>> > __interrupt void RXhandler (void)
>> > {
>> > =A0=A0=A0=A0=A0 if (IFG2 & UCA0RXIFG)
>> > =A0=A0 {
>> > =A0=A0=A0=A0=A0=A0 char rx=3DUCA0RXBUF;
>> > =A0=A0 kputchar(rx);
>> >
>> > =A0=A0 }
>> >
>> > code even does not jumps to rx handler so how can I get characters fro=
m
>> > terminal??
>> >
>> > rupesh IITkanpur
>> >
>> > See the Web's breaking stories, chosen by people like you. Check o=
ut
>> > Yahoo! Buzz. http://in.buzz..yahoo.com/
>> >
>> > [Non-text portions of this message have been removed]
>> >
>> >
>>=20
------------------------------------

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