EmbeddedRelated.com
Forums

Re: MSP430F1611 UART Receive Multiple Bytes From PC

Started by gusgl2001 February 14, 2008
I appreciate your sense of humor.
My question is, if the UART RX interrupt is supposed to be called
every time that a character is sent, then what could cause the
interrupts to be ignored and an interrupt to only be triggered for the
last character in a sequence?

--- In m..., One Stone wrote:
>
> Some of the questions here are more along the lines of:
>
> <>(Scene: Quiet street in the middle of night.)
> (Man crawling on all fours along the middle of the road.)
> (Policeman approaches.)
>
> Policeman: Sir, what are you doing?
> Man: Following the white line officer
> Policeman: Sir, why are you doing that?
> Man: Well I'm lost, and it looks like the one that goes past my house.
>
> Al
>
> old_cow_yellow wrote:
>
> >--- "Al Somerville" wrote:
> >
> >
> >>But the code is so much easier if it doesn't have to actually work!
> >>
> >>Al Somerville
> >>
> >>
> >>
> >(Scene: Quiet street in the middle of night.)
> >(Man crawling on all fours under the street light.)
> >(Policeman approaches.)
> >
> >Policeman: Sir, what are you doing?
> >Man: Looking for my car keys.
> >(Policeman joined the search.)
> >
> >(After a few minuets.)
> >Policeman: Are you sure you lost the keys here?
> >Man (pointing to the dark area of the street):
> > No, I dropped them over there.
> >Policeman: Why are you looking here?
> >Man: But the lighting is much better here.
> >
> >
> >
> >
> >
> >
> >
> >
> >

Beginning Microcontrollers with the MSP430

I'm assuming you really mean that UART RX interrupt is triggered for every byte that is received (not sent).
If that is correct, it sounds like you are dealing with a relatively fast baud rate and a relatively long interrupt latency. What is your CPU clock (MCLK) frequency? What is your baud rate? Do you have other interrupt handlers running? Do you run for long periods of time with interrupts disabled? Hopefully you've already asked yourself these questions, but if the rest of us also know the answers, we'll be better able to help.
-Aaron

----- Original Message -----
From: "gusgl2001"
To: m...
Sent: Thursday, February 14, 2008 3:05:50 PM (GMT-0700) America/Denver
Subject: [msp430] Re: MSP430F1611 UART Receive Multiple Bytes From PC

I appreciate your sense of humor.
My question is, if the UART RX interrupt is supposed to be called
every time that a character is sent, then what could cause the
interrupts to be ignored and an interrupt to only be triggered for the
last character in a sequence?

--- In m... , One Stone wrote:
>
> Some of the questions here are more along the lines of:
>
> <>(Scene: Quiet street in the middle of night.)
> (Man crawling on all fours along the middle of the road.)
> (Policeman approaches.)
>
> Policeman: Sir, what are you doing?
> Man: Following the white line officer
> Policeman: Sir, why are you doing that?
> Man: Well I'm lost, and it looks like the one that goes past my house.
>
> Al
>
> old_cow_yellow wrote:
>
> >--- "Al Somerville" wrote:
> >
> >
> >>But the code is so much easier if it doesn't have to actually work!
> >>
> >>Al Somerville
> >>
> >>
> >>
> >(Scene: Quiet street in the middle of night.)
> >(Man crawling on all fours under the street light.)
> >(Policeman approaches.)
> >
> >Policeman: Sir, what are you doing?
> >Man: Looking for my car keys.
> >(Policeman joined the search.)
> >
> >(After a few minuets.)
> >Policeman: Are you sure you lost the keys here?
> >Man (pointing to the dark area of the street):
> > No, I dropped them over there.
> >Policeman: Why are you looking here?
> >Man: But the lighting is much better here.
> >
> >
> >
> >
> >
> >
> >
> >
> >
There are some simple things which could cause it.

One is the speed you are trying to operate at coming out of the interrupt
versus the voltage level applied to the device. In low power applications
you need to be aware that the speed of the DCO is directly related to the
voltage applied to the device. There is a chart for each device that shows
the speed versus voltage operating envelope.

A second one is the time being spent in an interrupt. One of the nice things
about the MSP is that it is a single interrupt at a time with one interrupt
not being able to interrupt another. If you have ISR that is lengthy, you
may not return before the characters are gone.

Thanks,

Jim

_____

From: m... [mailto:m...] On Behalf Of
gusgl2001
Sent: Thursday, February 14, 2008 5:06 PM
To: m...
Subject: [msp430] Re: MSP430F1611 UART Receive Multiple Bytes From PC

I appreciate your sense of humor.
My question is, if the UART RX interrupt is supposed to be called
every time that a character is sent, then what could cause the
interrupts to be ignored and an interrupt to only be triggered for the
last character in a sequence?

--- In msp430@yahoogroups. com, One Stone
wrote:
>
> Some of the questions here are more along the lines of:
>
> <>(Scene: Quiet street in the middle of night.)
> (Man crawling on all fours along the middle of the road.)
> (Policeman approaches.)
>
> Policeman: Sir, what are you doing?
> Man: Following the white line officer
> Policeman: Sir, why are you doing that?
> Man: Well I'm lost, and it looks like the one that goes past my house.
>
> Al
>
> old_cow_yellow wrote:
>
> >--- "Al Somerville" wrote:
> >
> >
> >>But the code is so much easier if it doesn't have to actually work!
> >>
> >>Al Somerville
> >>
> >>
> >>
> >(Scene: Quiet street in the middle of night.)
> >(Man crawling on all fours under the street light.)
> >(Policeman approaches.)
> >
> >Policeman: Sir, what are you doing?
> >Man: Looking for my car keys.
> >(Policeman joined the search.)
> >
> >(After a few minuets.)
> >Policeman: Are you sure you lost the keys here?
> >Man (pointing to the dark area of the street):
> > No, I dropped them over there.
> >Policeman: Why are you looking here?
> >Man: But the lighting is much better here.
> >
> >
> >
> >
> >
> >> egroups.com
> >
> >
> >
--- In m..., "Jim Carlson" wrote:

I think there might be an Errata directly in relations to the second
statement below. In general, keep ISRs short. If you have to ask
the question "Is this interupt to long?" Then the answer is verly
likely to be "Yes, it is to long."

Dan

>
> There are some simple things which could cause it.
>
>
>
> One is the speed you are trying to operate at coming out of the
interrupt
> versus the voltage level applied to the device. In low power
applications
> you need to be aware that the speed of the DCO is directly related
to the
> voltage applied to the device. There is a chart for each device
that shows
> the speed versus voltage operating envelope.
>
>
>
> A second one is the time being spent in an interrupt. One of the
nice things
> about the MSP is that it is a single interrupt at a time with one
interrupt
> not being able to interrupt another. If you have ISR that is
lengthy, you
> may not return before the characters are gone.
>
>
>
>
>
>
>
> Thanks,
>
> Jim
>
>
>
> _____
>
> From: m... [mailto:m...] On
Behalf Of
> gusgl2001
> Sent: Thursday, February 14, 2008 5:06 PM
> To: m...
> Subject: [msp430] Re: MSP430F1611 UART Receive Multiple Bytes From
PC
>
>
>
> I appreciate your sense of humor.
> My question is, if the UART RX interrupt is supposed to be called
> every time that a character is sent, then what could cause the
> interrupts to be ignored and an interrupt to only be triggered for
the
> last character in a sequence?
>
> --- In msp430@yahoogroups. com,
One Stone
> wrote:
> >
> > Some of the questions here are more along the lines of:
> >
> > <>(Scene: Quiet street in the middle of night.)
> > (Man crawling on all fours along the middle of the road.)
> > (Policeman approaches.)
> >
> > Policeman: Sir, what are you doing?
> > Man: Following the white line officer
> > Policeman: Sir, why are you doing that?
> > Man: Well I'm lost, and it looks like the one that goes past my
house.
> >
> > Al
> >
> > old_cow_yellow wrote:
> >
> > >--- "Al Somerville" wrote:
> > >
> > >
> > >>But the code is so much easier if it doesn't have to actually
work!
> > >>
> > >>Al Somerville
> > >>
> > >>
> > >>
> > >(Scene: Quiet street in the middle of night.)
> > >(Man crawling on all fours under the street light.)
> > >(Policeman approaches.)
> > >
> > >Policeman: Sir, what are you doing?
> > >Man: Looking for my car keys.
> > >(Policeman joined the search.)
> > >
> > >(After a few minuets.)
> > >Policeman: Are you sure you lost the keys here?
> > >Man (pointing to the dark area of the street):
> > > No, I dropped them over there.
> > >Policeman: Why are you looking here?
> > >Man: But the lighting is much better here.
> > >
> > >
> > >
> > >
> > >
> > >>
egroups.com
> > >
> > >
> > >
OK.
I think I will also put my intialization code.
Here it is
Set_DCO(977); // Sets the DCO to 4 MHz, this is TI code
P3SEL |= 0x30;

BCSCTL1 |= DIVA_3;
ME |= UTXE0 + TRXE0;
UCTL0 |= CHAR;
UTCTL0 |= SSEL1 + SSEL0;
UBR00 = 0x22; // Values calculated using baud rate cal.
UBR10 = 0x00; // 115200 baud rate
UMCTL0 = 0xDD;
UCTL0 &= ~SWRST;
IE1 |= URXIE0;

This code actually worked for me some time ago. I would send a string
of numbers and on every number the interrupt would be stopped
(considering I didn't cause the BP to cause a delay and that string
afterwards to be lost because of my time on the BP.

--- In m..., Aaron Greer wrote:
>
> I'm assuming you really mean that UART RX interrupt is triggered for
every byte that is received (not sent).
> If that is correct, it sounds like you are dealing with a relatively
fast baud rate and a relatively long interrupt latency. What is your
CPU clock (MCLK) frequency? What is your baud rate? Do you have other
interrupt handlers running? Do you run for long periods of time with
interrupts disabled? Hopefully you've already asked yourself these
questions, but if the rest of us also know the answers, we'll be
better able to help.
> -Aaron
>
> ----- Original Message -----
> From: "gusgl2001"
> To: m...
> Sent: Thursday, February 14, 2008 3:05:50 PM (GMT-0700) America/Denver
> Subject: [msp430] Re: MSP430F1611 UART Receive Multiple Bytes From PC
>
> I appreciate your sense of humor.
> My question is, if the UART RX interrupt is supposed to be called
> every time that a character is sent, then what could cause the
> interrupts to be ignored and an interrupt to only be triggered for the
> last character in a sequence?
>
> --- In m... , One Stone wrote:
> >
> > Some of the questions here are more along the lines of:
> >
> > <>(Scene: Quiet street in the middle of night.)
> > (Man crawling on all fours along the middle of the road.)
> > (Policeman approaches.)
> >
> > Policeman: Sir, what are you doing?
> > Man: Following the white line officer
> > Policeman: Sir, why are you doing that?
> > Man: Well I'm lost, and it looks like the one that goes past my
house.
> >
> > Al
> >
> > old_cow_yellow wrote:
> >
> > >--- "Al Somerville" wrote:
> > >
> > >
> > >>But the code is so much easier if it doesn't have to actually work!
> > >>
> > >>Al Somerville
> > >>
> > >>
> > >>
> > >(Scene: Quiet street in the middle of night.)
> > >(Man crawling on all fours under the street light.)
> > >(Policeman approaches.)
> > >
> > >Policeman: Sir, what are you doing?
> > >Man: Looking for my car keys.
> > >(Policeman joined the search.)
> > >
> > >(After a few minuets.)
> > >Policeman: Are you sure you lost the keys here?
> > >Man (pointing to the dark area of the street):
> > > No, I dropped them over there.
> > >Policeman: Why are you looking here?
> > >Man: But the lighting is much better here.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
I'm looking for some MSP430 Address-Bit Multiprocessor Format example
code out there. While the TI documentation is good, I'm looking for any
public examples of doing this between at least three MSP430 boards.

Steve