From: Baxter on
I'm an experienced C/C++ programmer, but very new to Embedded programming.

I've bought the TI Flash developers kits that include the IAR compiler. I
have some existing msp430gcc code, but there are some differences -
particularly in how interrupts are declared.

The issues I need to resolve:
1) some of my interrupt routines are declared as "wakeup". It's unclear
to me how to handle these in IAR.
2) the IAR compiler can't find the _reset_vector__(). do I replace it
with "RESET_VECTOR" ?

--
-------------------------------------------------------------------------
Free software - Baxter Codeworks www.baxcode.com
-------------------------------------------------------------------------



From: Gene S. Berkowitz on
In article <11c8imklb8rccb2(a)corp.supernews.com>,
lbax02.spamguard(a)baxcode.com says...
> I'm an experienced C/C++ programmer, but very new to Embedded programming.
>
> I've bought the TI Flash developers kits that include the IAR compiler. I
> have some existing msp430gcc code, but there are some differences -
> particularly in how interrupts are declared.
>
> The issues I need to resolve:
> 1) some of my interrupt routines are declared as "wakeup". It's unclear
> to me how to handle these in IAR.
> 2) the IAR compiler can't find the _reset_vector__(). do I replace it
> with "RESET_VECTOR" ?
>
>

1) In IAR, insert the following in your interrupt handler:

_BIC_SR_IRQ(LPMx_bits);

This manipulates the copy of SR pushed on the stack; otherwise the
previous LPM state is restored when the interrupt returns. LPMx_bits
is the LPM mode you want to be in afterwards (i.e. LPM0_bits puts you in
LPM0 mode (full power). I think they've improved the syntax in newer
versions.

2) Indeed, you must use RESET_VECTOR. Refer to the \430\inc directory.
The vectors supported by a particular variant can be found at the END
of the appropriate MSP430xxxx.h file.

--Gene
From: Baxter on
Thanks, this is what I was looking for.

From the sound of things, on #1, it doesn't matter where in my interrupt
handler that I put the _BIC_SR_IRQ(LPMx_bits) macro. (I'll have to look up
and see what it does.)

--
-------------------------------------------------------------------------
Free software - Baxter Codeworks www.baxcode.com
-------------------------------------------------------------------------


"Gene S. Berkowitz" <first.last(a)comcast.net> wrote in message
news:MPG.1d2e88f6a414ed47989681(a)newsgroups.comcast.net...
> In article <11c8imklb8rccb2(a)corp.supernews.com>,
> lbax02.spamguard(a)baxcode.com says...
> > I'm an experienced C/C++ programmer, but very new to Embedded
programming.
> >
> > I've bought the TI Flash developers kits that include the IAR compiler.
I
> > have some existing msp430gcc code, but there are some differences -
> > particularly in how interrupts are declared.
> >
> > The issues I need to resolve:
> > 1) some of my interrupt routines are declared as "wakeup". It's
unclear
> > to me how to handle these in IAR.
> > 2) the IAR compiler can't find the _reset_vector__(). do I replace it
> > with "RESET_VECTOR" ?
> >
> >
>
> 1) In IAR, insert the following in your interrupt handler:
>
> _BIC_SR_IRQ(LPMx_bits);
>
> This manipulates the copy of SR pushed on the stack; otherwise the
> previous LPM state is restored when the interrupt returns. LPMx_bits
> is the LPM mode you want to be in afterwards (i.e. LPM0_bits puts you in
> LPM0 mode (full power). I think they've improved the syntax in newer
> versions.
>
> 2) Indeed, you must use RESET_VECTOR. Refer to the \430\inc directory.
> The vectors supported by a particular variant can be found at the END
> of the appropriate MSP430xxxx.h file.
>
> --Gene


From: Gene S. Berkowitz on
In article <11c9k0h3gaqri29(a)corp.supernews.com>,
lbax02.spamguard(a)baxcode.com says...
> Thanks, this is what I was looking for.
>
> From the sound of things, on #1, it doesn't matter where in my interrupt
> handler that I put the _BIC_SR_IRQ(LPMx_bits) macro. (I'll have to look up
> and see what it does.)
>
>

No, it should not matter, as long as you're not attempting to otherwise
manipulate the stack in the ISR. It's an intrinsic function unique to
the compiler; I don't THINK you can see the source, although it's easy
enough to view the resulting assembler output.

--Gene
From: Baxter on
I looked at the .h files - it looks like there's several different levels.
My guess is that I want LPM4_bits for "wakeup" (ie. restore everything to
active status - there's also a "LPM4_EXIT"). There's nowhere in my code
that explicitly sets the chip into low-power mode (at least not that I can
tell).

--
-------------------------------------------------------------------------
Free software - Baxter Codeworks www.baxcode.com
-------------------------------------------------------------------------


"Gene S. Berkowitz" <first.last(a)comcast.net> wrote in message
news:MPG.1d3072899d1b896b989682(a)newsgroups.comcast.net...
> In article <11c9k0h3gaqri29(a)corp.supernews.com>,
> lbax02.spamguard(a)baxcode.com says...
> > Thanks, this is what I was looking for.
> >
> > From the sound of things, on #1, it doesn't matter where in my interrupt
> > handler that I put the _BIC_SR_IRQ(LPMx_bits) macro. (I'll have to look
up
> > and see what it does.)
> >
> >
>
> No, it should not matter, as long as you're not attempting to otherwise
> manipulate the stack in the ISR. It's an intrinsic function unique to
> the compiler; I don't THINK you can see the source, although it's easy
> enough to view the resulting assembler output.
>
> --Gene