Sign in

username:

password:



Not a member?

Search msp430



Search tips

Subscribe to msp430



Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | MSP430 | problem with msp430f2272


Advertise Here

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.

problem with msp430f2272 - thuhang - Nov 18 22:52:10 2009


I write code for msp430f2272, complier not error, but it 's a error when I
rebuild all :
Error[e16]: Segment DATA16_Z (size: 0x80f align: 0x1) is too long for
segment definition. At least 0x481 more bytes needed. The problem occurred
while processing the segment placement command
"-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=0200-05FF",
where
at the moment of placement the available memory ranges were "CODE:271-5ff"
Reserved ranges relevant to this placement:
200-5ff DATA16_I
Who can help me with this problem ?
Thank you
--
View this message in context: http://old.nabble.com/problem-with-msp430f2272-tp26409588p26409588.html
Sent from the MSP430 - Discuss mailing list archive at Nabble.com.

------------------------------------



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


RE: problem with msp430f2272 - Paul Curtis - Nov 19 3:17:16 2009

Hi,

> I write code for msp430f2272, complier not error, but it 's a error when =
I
> rebuild all :
> Error[e16]: Segment DATA16_Z (size: 0x80f align: 0x1) is too long for
> segment definition. At least 0x481 more bytes needed. The problem occurre=
d
> while processing the segment placement command
> "-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=3D0200-
> 05FF",
> where
> at the moment of placement the available memory ranges were "CODE:271-5ff=
"
> Reserved ranges relevant to this placement:
> 200-5ff DATA16_I
> Who can help me with this problem ?

Get a bigger device or reduce your data.

--
Paul Curtis, Rowley Associates Ltd=A0=A0 http://www.rowley.co.uk
CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!

------------------------------------



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

Re: problem with msp430f2272 - Michael - Nov 19 18:07:36 2009

Thuhang:
Read the error again carefully:
> > Segment DATA16_Z (size: 0x80f align: 0x1) is too long for
> > segment definition. At least 0x481 more bytes needed.

It is telling you that it needs another 1153 bytes (0x481) of data memory (=
RAM). that's over 1kB more than you have available, which for a microcontro=
ller is a lot.

If you have large arrays with fixed data (like strings or font tables), try=
declaring them as static so the compiler doesn't make a copy of it in RAM.

You might also try reducing HEAP and/or STACK size if you know the implicat=
ions. If you don't know what they are or do, learn about them.

You can also lower your memory requirements by reducing array sizes or chan=
ging the type of variable to smaller ones where possible.

Michael K.
--- In m...@yahoogroups.com, "Paul Curtis" wrote:
>
> Hi,
>=20
> > I write code for msp430f2272, complier not error, but it 's a error whe=
n I
> > rebuild all :
> > Error[e16]: Segment DATA16_Z (size: 0x80f align: 0x1) is too long for
> > segment definition. At least 0x481 more bytes needed. The problem occur=
red
> > while processing the segment placement command
> > "-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=3D020=
0-
> > 05FF",
> > where
> > at the moment of placement the available memory ranges were "CODE:271-5=
ff"
> > Reserved ranges relevant to this placement:
> > 200-5ff DATA16_I
> > Who can help me with this problem ?
>=20
> Get a bigger device or reduce your data.
>=20
> --
> Paul Curtis, Rowley Associates Ltd=A0=A0 http://www.rowley.co.uk
> CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
>

------------------------------------



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

Re: problem with msp430f2272 - thuhang - Nov 20 6:15:11 2009


Hi Michael
Do my problem relate to Ram memory . I have a error :
Error[e16]: Segment INTVEC (size: 0x2e align: 0x1) is too long for segment
definition. At least 0xe more bytes needed. The problem occurred while=20
processing the segment placement command "-Z(CODE)INTVEC=3DFFE0-FFFF", wher=
e
at the moment of placement the available memory ranges were=20=20
"CODE:ffe0-ffff"=20
I think , I need least Oxe bytes , now, I use msp430f2272 , 1k Ram, after I
try to use msp430f2370 it have 2k ram , but It's still have old error=20
can you help me ?
thanks
Michael-544 wrote:
>=20
> Thuhang:
> Read the error again carefully:
>> > Segment DATA16_Z (size: 0x80f align: 0x1) is too long for
>> > segment definition. At least 0x481 more bytes needed.
>=20
> It is telling you that it needs another 1153 bytes (0x481) of data memory
> (RAM). that's over 1kB more than you have available, which for a
> microcontroller is a lot.
>=20
> If you have large arrays with fixed data (like strings or font tables),
> try declaring them as static so the compiler doesn't make a copy of it in
> RAM.
>=20
> You might also try reducing HEAP and/or STACK size if you know the
> implications. If you don't know what they are or do, learn about them.
>=20
> You can also lower your memory requirements by reducing array sizes or
> changing the type of variable to smaller ones where possible.
>=20
> Michael K.
>=20
>=20
> --- In m...@yahoogroups.com, "Paul Curtis" wrote:
>>
>> Hi,
>>=20
>> > I write code for msp430f2272, complier not error, but it 's a error
>> when I
>> > rebuild all :
>> > Error[e16]: Segment DATA16_Z (size: 0x80f align: 0x1) is too long for
>> > segment definition. At least 0x481 more bytes needed. The problem
>> occurred
>> > while processing the segment placement command
>> > "-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=3D02=
00-
>> > 05FF",
>> > where
>> > at the moment of placement the available memory ranges were
>> "CODE:271-5ff"
>> > Reserved ranges relevant to this placement:
>> > 200-5ff DATA16_I
>> > Who can help me with this problem ?
>>=20
>> Get a bigger device or reduce your data.
>>=20
>> --
>> Paul Curtis, Rowley Associates Ltd=C2=A0=C2=A0 http://www.rowley.co.uk
>> CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
>>
>=20
>=20
>=20
>=20

--=20
View this message in context: http://old.nabble.com/problem-with-msp430f227=
2-tp26409588p26438750.html
Sent from the MSP430 - Discuss mailing list archive at Nabble.com.

------------------------------------



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

Re: problem with msp430f2272 - bb_stefan - Nov 20 9:32:28 2009

Have you selected the correct MSP derivate in the options dialog box before built?
Have you modified the linker command file?

------------------------------------



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

Re: problem with msp430f2272 - thuhang - Nov 20 9:42:08 2009


I selected the correct MSP derivate in the options dialog box before built
I don't know about modified the linker command file
You can help me about problem ?

thuhang wrote:
>
> I write code for msp430f2272, complier not error, but it 's a error when I
> rebuild all :
> Error[e16]: Segment DATA16_Z (size: 0x80f align: 0x1) is too long for
> segment definition. At least 0x481 more bytes needed. The problem occurred
> while processing the segment placement command
> "-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=0200-05FF",
> where
> at the moment of placement the available memory ranges were "CODE:271-5ff"
> Reserved ranges relevant to this placement:
> 200-5ff DATA16_I
> Who can help me with this problem ?
> Thank you
>

--
View this message in context: http://old.nabble.com/problem-with-msp430f2272-tp26409588p26441742.html
Sent from the MSP430 - Discuss mailing list archive at Nabble.com.

------------------------------------



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

Re: problem with msp430f2272 - bb_stefan - Nov 20 11:05:56 2009


> You can help me about problem ?

Not really... insufficient information!
As said before, you are using more RAM than you have available.
Maybe you are using some structures with incorrect alignment, so byte padding occurs, which blows up your RAM consumption, without noticing it?!

Also very strange:
>Error[e16]: Segment INTVEC (size: 0x2e align: 0x1) is too long for >segment definition
This can -in my opinion- only occur if you choose the wrong MSP derivate or have incorrectly modified linker command file.

------------------------------------



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

Re: Re: problem with msp430f2272 - huynh hang - Nov 20 11:11:45 2009

Hi bb_stefan
I chose MSP430f2272 in option, but I don't known chose modified linker comm=
and file.You can give me your advise=20
thanks you=20

--- On Fri, 11/20/09, bb_stefan wrote:

From: bb_stefan
Subject: [msp430] Re: problem with msp430f2272
To: m...@yahoogroups.com
Date: Friday, November 20, 2009, 11:03 PM

=C2=A0

=20=20
=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20

> You can help me about problem ?

Not really... insufficient information!

As said before, you are using more RAM than you have available.

Maybe you are using some structures with incorrect alignment, so byte paddi=
ng occurs, which blows up your RAM consumption, without noticing it?!

Also very strange:

>Error[e16]: Segment INTVEC (size: 0x2e align: 0x1) is too long for >segmen=
t definition

This can -in my opinion- only occur if you choose the wrong MSP derivate or=
have incorrectly modified linker command file.

=20=20=20=20
=20=20=20=20=20

=20=20=20=20
=20=20=20=20
=20

=20=20

=20=20=20=20=20=20

[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: problem with msp430f2272 - bb_stefan - Nov 20 13:11:29 2009

>but I don't known chose modified linker command file.
Do NOT modify the linker command file (unless you know what to do with it). Use the default one, which is done automatically!
I only thought you made changes, leading to the error...!

>You can give me your advise
Nobody can, unless you provide us with more detailed information about the variables you are using, leading to RAM overflow!

------------------------------------



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

Re: Re: problem with msp430f2272 - huynh hang - Nov 20 13:38:00 2009

Thanks about your ideas
I dowdload applications notes in TI web : wireless MBUS Implementation with=
cc1101 and MSP430=C2=A0=C2=A0 . I aldreay chose in Option with MSP430f2272=
in General options, and addtional include directories in C/C++ Compier , I=
t 's have errors : Error[e16]: Segment DATA16_Z (size: 0x7ed align: 0x1) is=
too long for segment definition. At least 0x45f more bytes needed. The pro=
blem occurred while processing the segment placement command "-Z(DATA)DATA1=
6_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=3D0200-05FF", where=C2=
=A0 at the moment of placement the available memory ranges were "CODE:271-5=
ff"=20
=C2=A0=C2=A0 Reserved ranges relevant to this placement:=20
=C2=A0=C2=A0 200-5ff=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 DATA16_I=20
=C2=A0=C2=A0=20
I think that , Ram Memory isn't enough , I try to use MSP430f2370 2K Ram, b=
ut it 'still have a old error . I try reject some code not use but not acti=
on
=C2=A0

--- On Sat, 11/21/09, bb_stefan wrote:

From: bb_stefan
Subject: [msp430] Re: problem with msp430f2272
To: m...@yahoogroups.com
Date: Saturday, November 21, 2009, 1:07 AM

=C2=A0

=20=20
=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20
>but I don't known chose modified linker command file.

Do NOT modify the linker command file (unless you know what to do with it).=
Use the default one, which is done automatically!

I only thought you made changes, leading to the error...!

>You can give me your advise=20

Nobody can, unless you provide us with more detailed information about the =
variables you are using, leading to RAM overflow!

=20=20=20=20
=20=20=20=20=20

=20=20=20=20
=20=20=20=20
=20

=20=20

=20=20=20=20=20=20

[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: problem with msp430f2272 - "Redd, Emmett R" - Nov 20 13:49:32 2009

Not knowing the compiler, but knowing hexadecimal math your DATA16_Z is too big. It is 0x7ed long. All the available space you have is 0x271 to 0x5ff (that is, 0x38e bytes). If one subtracts 0x38e from 0x7ed, 0x45f results. That is how many more bytes are needed (as the error says).

HTH I don't know why your 2K RAM chip does not work. But it could be you need to redefine a RAM segment in your code.

Emmett Redd Ph.D. mailto:E...@missouristate.edu
Professor (417)836-5221
Department of Physics, Astronomy, and Materials Science
Missouri State University Fax (417)836-6226
901 SOUTH NATIONAL Lab (417)836-3770
SPRINGFIELD, MO 65897 USA Dept (417)836-5131

"In theory there is no difference between theory and practice. In practice there is." -- Yogi Berra or Jan van de Snepscheut

________________________________________
From: m...@yahoogroups.com [m...@yahoogroups.com] On Behalf Of huynh hang [h...@yahoo.com]
Sent: Friday, November 20, 2009 12:37 PM
To: m...@yahoogroups.com
Subject: Re: [msp430] Re: problem with msp430f2272

Thanks about your ideas
I dowdload applications notes in TI web : wireless MBUS Implementation with cc1101 and MSP430 . I aldreay chose in Option with MSP430f2272 in General options, and addtional include directories in C/C++ Compier , It 's have errors : Error[e16]: Segment DATA16_Z (size: 0x7ed align: 0x1) is too long for segment definition. At least 0x45f more bytes needed. The problem occurred while processing the segment placement command "-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=0200-05FF", where at the moment of placement the available memory ranges were "CODE:271-5ff"
Reserved ranges relevant to this placement:
200-5ff DATA16_I

I think that , Ram Memory isn't enough , I try to use MSP430f2370 2K Ram, but it 'still have a old error . I try reject some code not use but not action

--- On Sat, 11/21/09, bb_stefan wrote:

From: bb_stefan
Subject: [msp430] Re: problem with msp430f2272
To: m...@yahoogroups.com
Date: Saturday, November 21, 2009, 1:07 AM

>but I don't known chose modified linker command file.

Do NOT modify the linker command file (unless you know what to do with it). Use the default one, which is done automatically!

I only thought you made changes, leading to the error...!

>You can give me your advise

Nobody can, unless you provide us with more detailed information about the variables you are using, leading to RAM overflow!

[Non-text portions of this message have been removed]

------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



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

Re: problem with msp430f2272 - bb_stefan - Nov 20 14:00:29 2009

> I dowdload applications notes in TI web : wireless MBUS=20
> Implementation with cc1101 and MSP430=C2=A0=C2=A0=20

Come on...
... the experimenter's board uses a MSP430FG4618 with 8k RAM !!!

Are you using the sample code from the app note you mentioned before?
>// TX - Buffers
>uint8 TXdata[256];
>uint8 TXdataLength =3D 5;
>uint8 TXpacket[291];
>uint8 TXbytes[584];

>// RX - Buffers
>uint8 RXpacket[291];
>uint8 RXbytes[584];

Only these global variables need 2006 bytes!
There are many more... for sure!

------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



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

Re: Re: problem with msp430f2272 - huynh hang - Nov 20 14:06:47 2009

Oh , thanks you a lot=20

--- On Sat, 11/21/09, bb_stefan wrote:

From: bb_stefan
Subject: [msp430] Re: problem with msp430f2272
To: m...@yahoogroups.com
Date: Saturday, November 21, 2009, 1:59 AM

=C2=A0

=20=20
=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20
> I dowdload applications notes in TI web : wireless MBUS=20

> Implementation with cc1101 and MSP430=C3=82=C2=A0=C3=82=C2=A0=20

Come on...

... the experimenter' s board uses a MSP430FG4618 with 8k RAM !!!

Are you using the sample code from the app note you mentioned before?

>// TX - Buffers

>uint8 TXdata[256];

>uint8 TXdataLength =3D 5;

>uint8 TXpacket[291] ;

>uint8 TXbytes[584] ;

>// RX - Buffers

>uint8 RXpacket[291] ;

>uint8 RXbytes[584] ;

Only these global variables need 2006 bytes!

There are many more... for sure!

=20=20=20=20
=20=20=20=20=20

=20=20=20=20
=20=20=20=20
=20

=20=20

=20=20=20=20=20=20

[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: problem with msp430f2272 - huynh hang - Nov 20 15:12:56 2009

Hi bb_stefan
I have 40 slave : 1cc1101 and 1 msp 430 , and 1 master : 1 cc1101 anh msp 4=
30 .I don't know to discern data from 40 cc1101 of slave stranmit cc1101 of=
master . You can give for me your advise
thanks you

--- On Sat, 11/21/09, bb_stefan wrote:

From: bb_stefan
Subject: [msp430] Re: problem with msp430f2272
To: m...@yahoogroups.com
Date: Saturday, November 21, 2009, 1:59 AM

=C2=A0

=20=20
=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20
> I dowdload applications notes in TI web : wireless MBUS=20

> Implementation with cc1101 and MSP430=C3=82=C2=A0=C3=82=C2=A0=20

Come on...

... the experimenter' s board uses a MSP430FG4618 with 8k RAM !!!

Are you using the sample code from the app note you mentioned before?

>// TX - Buffers

>uint8 TXdata[256];

>uint8 TXdataLength =3D 5;

>uint8 TXpacket[291] ;

>uint8 TXbytes[584] ;

>// RX - Buffers

>uint8 RXpacket[291] ;

>uint8 RXbytes[584] ;

Only these global variables need 2006 bytes!

There are many more... for sure!

=20=20=20=20
=20=20=20=20=20

=20=20=20=20
=20=20=20=20
=20

=20=20

=20=20=20=20=20=20

[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: problem with msp430f2272 - thuhang - Nov 21 5:19:51 2009


Hi bb stefan
you tell me that I choose the wrong MSP derivate or have incorrectly
modified linker command file.You can guide me choose right
Thank you
bb_stefan-2 wrote:
>> You can help me about problem ?
>
> Not really... insufficient information!
> As said before, you are using more RAM than you have available.
> Maybe you are using some structures with incorrect alignment, so byte
> padding occurs, which blows up your RAM consumption, without noticing it?!
>
> Also very strange:
>>Error[e16]: Segment INTVEC (size: 0x2e align: 0x1) is too long for
>segment definition
> This can -in my opinion- only occur if you choose the wrong MSP derivate
> or have incorrectly modified linker command file.

--
View this message in context: http://old.nabble.com/problem-with-msp430f2272-tp26409588p26454690.html
Sent from the MSP430 - Discuss mailing list archive at Nabble.com.

------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



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

RE: problem with msp430f2272 - Jim Carlson - Nov 21 11:55:54 2009

Is it not also that he has the right choice in processor that he intends to
use, but has just used more memory that the processor has to allocate. I do
not recall all the segment definitions, but problems like this can generally
be traced to using more memory than what is available. One area that is
neglected is the growth in stack size as more and more functions are used.
Each time a function is called the space for function related variables
[unless globally defined] is allocated on the stack as well as return
address information. A few other bytes are also needed; but I digress. As
functions are nested, the stack grows; the memory size is a constant.

All this may be mute as bb_stefan has responded to far more problems than I
have and may be able to shed more light.

Jim

From: m...@yahoogroups.com [mailto:m...@yahoogroups.com] On Behalf Of
thuhang
Sent: Saturday, November 21, 2009 5:20 AM
To: m...@yahoogroups.com
Subject: Re: [msp430] problem with msp430f2272

Hi bb stefan
you tell me that I choose the wrong MSP derivate or have incorrectly
modified linker command file.You can guide me choose right
Thank you

bb_stefan-2 wrote:
>> You can help me about problem ?
>
> Not really... insufficient information!
> As said before, you are using more RAM than you have available.
> Maybe you are using some structures with incorrect alignment, so byte
> padding occurs, which blows up your RAM consumption, without noticing it?!
>
> Also very strange:
>>Error[e16]: Segment INTVEC (size: 0x2e align: 0x1) is too long for
>segment definition
> This can -in my opinion- only occur if you choose the wrong MSP derivate
> or have incorrectly modified linker command file.

--
View this message in context:
http://old.nabble.com/problem-with-msp430f2272-tp26409588p26454690.html
Sent from the MSP430 - Discuss mailing list archive at Nabble.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: problem with msp430f2272 - huynh hang - Nov 21 13:22:28 2009

Sorry, I don't understand your idea .You can speak express about my problem=
. I know that INTVEC relate interrupt vector . In my code , I use interrup=
t at :
static ISR_FUNC_PTR port1_isr_tbl[8] =3D {0};
static ISR_FUNC_PTR port2_isr_tbl[8] =3D {0};
#pragma vector=3DPORT1_VECTOR
__interrupt void port1_ISR(void)
{
=C2=A0=C2=A0=C2=A0 register uint8 i;
=C2=A0=C2=A0=C2=A0 if (P1IFG)
=C2=A0=C2=A0=C2=A0 {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 8 ;i++)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 register=
const uint8 pinmask =3D 1 << i;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((P1I=
FG & pinmask) && (P1IE & pinmask) && (port1_isr_tbl[i] !=3D 0))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 (*port1_isr_tbl[i])();
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 P1IFG &=3D ~pinmask;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 __low_power_mode_off_on_exit();
=C2=A0=C2=A0=C2=A0 }
}

//-------------------------------------------------------------------------=
---------
//-------------------------------------------------------------------------=
---------
#pragma vector=3DPORT2_VECTOR
__interrupt void port2_ISR(void)
{
=C2=A0=C2=A0=C2=A0 register uint8 i;
=C2=A0=C2=A0=C2=A0 if (P2IFG)
=C2=A0=C2=A0=C2=A0 {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 8; i++)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 register=
const uint8 pinmask =3D 1 << i;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((P2I=
FG & pinmask) && (P2IE & pinmask) && (port2_isr_tbl[i] !=3D 0))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 (*port2_isr_tbl[i])();
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 P2IFG &=3D ~pinmask;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 __low_power_mode_off_on_exit();
=C2=A0=C2=A0=C2=A0 }
}
--- On Sat, 11/21/09, Jim Carlson wrote:

From: Jim Carlson
Subject: RE: [msp430] problem with msp430f2272
To: m...@yahoogroups.com
Date: Saturday, November 21, 2009, 11:55 PM

=C2=A0

=20=20
=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20
Is it not also that he has the right choice in processor that he inte=
nds to

use, but has just used more memory that the processor has to allocate. I do

not recall all the segment definitions, but problems like this can generall=
y

be traced to using more memory than what is available. One area that is

neglected is the growth in stack size as more and more functions are used.

Each time a function is called the space for function related variables

[unless globally defined] is allocated on the stack as well as return

address information. A few other bytes are also needed; but I digress. As

functions are nested, the stack grows; the memory size is a constant.

All this may be mute as bb_stefan has responded to far more problems than I

have and may be able to shed more light.

Jim

From: msp430@yahoogroups. com [mailto:msp430@yahoogroups. com] On Behalf Of

thuhang

Sent: Saturday, November 21, 2009 5:20 AM

To: msp430@yahoogroups. com

Subject: Re: [msp430] problem with msp430f2272

Hi bb stefan

you tell me that I choose the wrong MSP derivate or have incorrectly

modified linker command file.You can guide me choose right

Thank you

bb_stefan-2 wrote:

>=20

>=20

>> You can help me about problem ?

>=20

> Not really... insufficient information!

> As said before, you are using more RAM than you have available.

> Maybe you are using some structures with incorrect alignment, so byte

> padding occurs, which blows up your RAM consumption, without noticing it?=
!

>=20

> Also very strange:

>>Error[e16] : Segment INTVEC (size: 0x2e align: 0x1) is too long for

>segment definition

> This can -in my opinion- only occur if you choose the wrong MSP derivate

> or have incorrectly modified linker command file.

>=20

>=20

>=20

>=20

--=20

View this message in context:

http://old.nabble. com/problem- with-msp430f2272 -tp26409588p2645 4690.html

Sent from the MSP430 - Discuss mailing list archive at Nabble.com.

[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=20
=20

=20=20

=20=20=20=20=20=20

[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: problem with msp430f2272 - micr...@virginbroadband.com.au - Nov 21 14:01:36 2009

Hi,

What is ISR_FUNC_PTR ? Is it a typedef ?
It needs to be a 'plain ' function pointer, that means a pointer to a
function which is NON-ISR.
Or is ISR_FUNC_PTR an intrinsic in your compiler ?

I also don't understand why you have the 2 func ptr arrays as static ?
The only reason to use function ptrs in the ISRs is to be able to change
the actual end-ISR function at runtime,
but you can't update the tables from any other modules ?

In any case, make sure that the 2 func ptr arrays are for plain func
pointers, else your compiler/linker
(if it's some flavour of intrinsic) might be trying to place the 2 arrays
in INTVEC. If it does that you will either exceed
size of INTVEC, or your tables want to be placed in Flash - when they
should be in RAM.

HTH
B Rgds
Kris

On Sat, 21 Nov 2009 10:21:13 -0800 (PST), huynh hang
wrote:
> Sorry, I don't understand your idea .You can speak express about my
> problem . I know that INTVEC relate interrupt vector . In my code , I
use
> interrupt at :
> static ISR_FUNC_PTR port1_isr_tbl[8] = {0};
> static ISR_FUNC_PTR port2_isr_tbl[8] = {0};
> #pragma vector=PORT1_VECTOR
> __interrupt void port1_ISR(void)
> {
>     register uint8 i;
>     if (P1IFG)
>     {
>         for (i = 0; i < 8 ;i++)
>         {
>             register const uint8 pinmask = 1 << i;
>             if ((P1IFG & pinmask) && (P1IE & pinmask) &&
(port1_isr_tbl[i]
> != 0))
>             {
>                 (*port1_isr_tbl[i])();
>                 P1IFG &= ~pinmask;
>             }
>         }
>         __low_power_mode_off_on_exit();
>     }
> }
//----------------------------------------------------------------------------------
>
//----------------------------------------------------------------------------------
> #pragma vector=PORT2_VECTOR
> __interrupt void port2_ISR(void)
> {
>     register uint8 i;
>     if (P2IFG)
>     {
>         for (i = 0; i < 8; i++)
>         {
>             register const uint8 pinmask = 1 << i;
>             if ((P2IFG & pinmask) && (P2IE & pinmask) &&
(port2_isr_tbl[i]
> != 0))
>             {
>                 (*port2_isr_tbl[i])();
>                 P2IFG &= ~pinmask;
>             }
>         }
>         __low_power_mode_off_on_exit();
>     }
> }
> --- On Sat, 11/21/09, Jim Carlson wrote:
>
> From: Jim Carlson
> Subject: RE: [msp430] problem with msp430f2272
> To: m...@yahoogroups.com
> Date: Saturday, November 21, 2009, 11:55 PM
>
>  
>
>
>
>
>
> Is it not also that he has the right choice in processor that he
> intends to
>
> use, but has just used more memory that the processor has to allocate. I
do
>
> not recall all the segment definitions, but problems like this can
> generally
>
> be traced to using more memory than what is available. One area that is
>
> neglected is the growth in stack size as more and more functions are
used.
>
> Each time a function is called the space for function related variables
>
> [unless globally defined] is allocated on the stack as well as return
>
> address information. A few other bytes are also needed; but I digress.
As
>
> functions are nested, the stack grows; the memory size is a constant.
>
> All this may be mute as bb_stefan has responded to far more problems
than I
>
> have and may be able to shed more light.
>
> Jim
>
> From: msp430@yahoogroups. com [mailto:msp430@yahoogroups. com] On Behalf
Of
>
> thuhang
>
> Sent: Saturday, November 21, 2009 5:20 AM
>
> To: msp430@yahoogroups. com
>
> Subject: Re: [msp430] problem with msp430f2272
>
> Hi bb stefan
>
> you tell me that I choose the wrong MSP derivate or have incorrectly
>
> modified linker command file.You can guide me choose right
>
> Thank you
>
> bb_stefan-2 wrote:
>
>>>>> You can help me about problem ?
>
>>> Not really... insufficient information!
>
>> As said before, you are using more RAM than you have available.
>
>> Maybe you are using some structures with incorrect alignment, so byte
>
>> padding occurs, which blows up your RAM consumption, without noticing
>> it?!
>
>>> Also very strange:
>
>>>Error[e16] : Segment INTVEC (size: 0x2e align: 0x1) is too long for
>
>>segment definition
>
>> This can -in my opinion- only occur if you choose the wrong MSP
derivate
>
>> or have incorrectly modified linker command file.
>
>>>>>
------------------------------------



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

RE: problem with msp430f2272 - huynh hang - Nov 21 14:36:38 2009

Hi.
You can find infomation about ISR_FUNC_PTR in my file

--- On Sun, 11/22/09, m...@virginbroadband.com.au band.com.au> wrote:

From: m...@virginbroadband.com.au
Subject: RE: [msp430] problem with msp430f2272
To: m...@yahoogroups.com
Date: Sunday, November 22, 2009, 2:00 AM

=C2=A0

=20=20
=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20
Hi,

What i_Fs ISRUNC_PTR ? Is it a typedef ?

It needs to be a 'plain ' function pointer, that means a pointer to a

function which is NON-ISR.

Or is ISR_FUNC_PTR an intrinsic in your compiler ?

I also don't understand why you have the 2 func ptr arrays as static ?

The only reason to use function ptrs in the ISRs is to be able to change

the actual end-ISR function at runtime,

but you can't update the tables from any other modules ?

In any case, make sure that the 2 func ptr arrays are for plain func

pointers, else your compiler/linker

(if it's some flavour of intrinsic) might be trying to place the 2 arrays

in INTVEC. If it does that you will either exceed

size of INTVEC, or your tables want to be placed in Flash - when they

should be in RAM.

HTH

B Rgds

Kris

On Sat, 21 Nov 2009 10:21:13 -0800 (PST), huynh hang

wrote:

> Sorry, I don't understand your idea .You can speak express about my

> problem . I know that INTVEC relate interrupt vector . In my code , I

use

> interrupt at :

> static ISR_FUNC_PTR port1_isr_tbl[ 8] =3D {0};

> static ISR_FUNC_PTR port2_isr_tbl[ 8] =3D {0};

> #pragma vector=3DPORT1_ VECTOR

> __interrupt void port1_ISR(void)

> {

> =C2=A0=C2=A0=C2=A0 register uint8 i;

> =C2=A0=C2=A0=C2=A0 if (P1IFG)

> =C2=A0=C2=A0=C2=A0 {

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 8 ;i++)

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 regist=
er const uint8 pinmask =3D 1 << i;

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((P=
1IFG & pinmask) && (P1IE & pinmask) &&

(port1_isr_tbl[ i]

> !=3D 0))

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 (*port1_isr_ tbl[i])() ;

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 P1IFG &=3D ~pinmask;

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 __low_power_ mode_off_ on_exit=
() ;

> =C2=A0=C2=A0=C2=A0 }

> }

>=20

>

//---------- --------- --------- --------- --------- --------- ---

>

//---------- --------- --------- --------- --------- --------- ---

> #pragma vector=3DPORT2_ VECTOR

> __interrupt void port2_ISR(void)

> {

> =C2=A0=C2=A0=C2=A0 register uint8 i;

> =C2=A0=C2=A0=C2=A0 if (P2IFG)

> =C2=A0=C2=A0=C2=A0 {

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 8; i++)

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 regist=
er const uint8 pinmask =3D 1 << i;

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ((P=
2IFG & pinmask) && (P2IE & pinmask) &&

(port2_isr_tbl[ i]

> !=3D 0))

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 (*port2_isr_ tbl[i])() ;

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 P2IFG &=3D ~pinmask;

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }

> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 __low_power_ mode_off_ on_exit=
() ;

> =C2=A0=C2=A0=C2=A0 }

> }

>=20

>=20

> --- On Sat, 11/21/09, Jim Carlson wrote:

>=20

> From: Jim Carlson

> Subject: RE: [msp430] problem with msp430f2272

> To: msp430@yahoogroups. com

> Date: Saturday, November 21, 2009, 11:55 PM

>=20

>=20

>=20

>=20

>=20

>=20

>=20

> =C2=A0

>=20

>=20

>=20

>=20=20=20

>=20

>=20

>=20=20=20=20=20

>=20=20=20=20=20=20=20

>=20=20=20=20=20=20=20

> Is it not also that he has the right choice in processor that he

> intends to

>=20

> use, but has just used more memory that the processor has to allocate. I

do

>=20

> not recall all the segment definitions, but problems like this can

> generally

>=20

> be traced to using more memory than what is available. One area that is

>=20

> neglected is the growth in stack size as more and more functions are

used.

>=20

> Each time a function is called the space for function related variables

>=20

> [unless globally defined] is allocated on the stack as well as return

>=20

> address information. A few other bytes are also needed; but I digress.

As

>=20

> functions are nested, the stack grows; the memory size is a constant.

>=20

>=20

>=20

> All this may be mute as bb_stefan has responded to far more problems

than I

>=20

> have and may be able to shed more light.

>=20

>=20

>=20

> Jim

>=20

>=20

>=20

> From: msp430@yahoogroups. com [mailto:msp430@ yahoogroups. com] On Behalf

Of

>=20

> thuhang

>=20

> Sent: Saturday, November 21, 2009 5:20 AM

>=20

> To: msp430@yahoogroups. com

>=20

> Subject: Re: [msp430] problem with msp430f2272

>=20

>=20

>=20

> Hi bb stefan

>=20

> you tell me that I choose the wrong MSP derivate or have incorrectly

>=20

> modified linker command file.You can guide me choose right

>=20

> Thank you

>=20

>=20

>=20

> bb_stefan-2 wrote:

>=20

>>=20

>=20

>>=20

>=20

>>> You can help me about problem ?

>=20

>>=20

>=20

>> Not really... insufficient information!

>=20

>> As said before, you are using more RAM than you have available.

>=20

>> Maybe you are using some structures with incorrect alignment, so byte

>=20

>> padding occurs, which blows up your RAM consumption, without noticing

>> it?!

>=20

>>=20

>=20

>> Also very strange:

>=20

>>>Error[e16] : Segment INTVEC (size: 0x2e align: 0x1) is too long for

>=20

>>segment definition

>=20

>> This can -in my opinion- only occur if you choose the wrong MSP

derivate

>=20

>> or have incorrectly modified linker command file.

>=20

>>=20

>=20

>>=20

>=20

>>=20

>=20

>>

=20=20=20=20
=20=20=20=20=20

=20=20=20=20
=20=20=20=20
=20

=20=20

=20=20=20=20=20=20

[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: problem with msp430f2272 - huynh hang - Nov 21 15:12:28 2009

Hi bb stefan

My error when build MSP430f2272 with IAR:=20
Error[e16]: Segment INTVEC (size: 0x2e align: 0x1) is too long for segment =
definition. At least 0xe more bytes needed. The problem occurred while proc=
essing the segment placement command=C2=A0 "-Z(CODE)INTVEC=3DFFE0-FFFF", wh=
ere at the moment of placement the available memory ranges were=C2=A0 "CODE=
:ffe0-ffff" =C2=A0=C2=A0 Reserved ranges relevant to this placement:=20
=C2=A0=C2=A0 ffe0-ffff=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 INTVEC=20
you tell me that I choose the wrong MSP derivate or have incorrectly
modified linker command file.You can guide me choose right
=C2=A0Thank you
=C2=A0

--- On Sat, 11/21/09, bb_stefan wrote:

From: bb_stefan
Subject: [msp430] Re: problem with msp430f2272
To: m...@yahoogroups.com
Date: Saturday, November 21, 2009, 1:59 AM

=C2=A0

=20=20
=20=20=20=20
=20=20=20=20=20=20
=20=20=20=20=20=20
> I dowdload applications notes in TI web : wireless MBUS=20

> Implementation with cc1101 and MSP430=C3=82=C2=A0=C3=82=C2=A0=20

Come on...

... the experimenter' s board uses a MSP430FG4618 with 8k RAM !!!

Are you using the sample code from the app note you mentioned before?

>// TX - Buffers

>uint8 TXdata[256];

>uint8 TXdataLength =3D 5;

>uint8 TXpacket[291] ;

>uint8 TXbytes[584] ;

>// RX - Buffers

>uint8 RXpacket[291] ;

>uint8 RXbytes[584] ;

Only these global variables need 2006 bytes!

There are many more... for sure!

=20=20=20=20
=20=20=20=20=20

=20=20=20=20
=20=20=20=20
=20

=20=20

=20=20=20=20=20=20

[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: problem with msp430f2272 - bb_stefan - Nov 21 16:34:20 2009

You must read my answers ;-)

The code from TI's AppNote you are using (so do I suppose!)
is written for an MSP430FG4618 At least this derivate is used on the experimenter's board (http://focus.ti.com/docs/toolsw/folders/print/msp-exp430fg4618.html).
This device has different INT_VECTORS (-Z(CODE)INTVEC=FFC0-FFFF) than your F2xx devices (-Z(CONST)INTVEC=FFE0-FFFF).

So you CANNOT use your F2xx devices with the code you are using!
Either change the code accordingly or use an appropriate MSP!

Unfortunately I have neither experience with F4xx devices nor with CCxxx RF-modules, so I can't help you with these specific topics!

------------------------------------



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

Re: problem with msp430f2272 - Paul Curtis - Nov 22 19:04:53 2009

...just a quick observation:

> __interrupt void port1_ISR(void)
> {
> register uint8 i;
> if (P1IFG)
> {
> for (i = 0; i < 8 ;i++)
> {
> register const uint8 pinmask = 1 << i;
> if ((P1IFG & pinmask) && (P1IE & pinmask) &&
> (port1_isr_tbl[i] != 0))
You could write this:

if ((P1IFG & P1IE & pinmask) && (port1_isr_tbl[i] != 0))

Every cycle counts, it's easier to read, and P1IFG & P1IE mimics what the
MSP430 does internally.

Again, just a thought...

-- Paul.
CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



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

Re: problem with msp430f2272 - Dan Bloomquist - Nov 22 20:27:20 2009

Paul Curtis wrote:
> ...just a quick observation:
>
>
>> __interrupt void port1_ISR(void)
>> {
>> register uint8 i;
>> if (P1IFG)
>> {
>> for (i = 0; i < 8 ;i++)
>> {
>> register const uint8 pinmask = 1 << i;
>> if ((P1IFG & pinmask) && (P1IE & pinmask) &&
>> (port1_isr_tbl[i] != 0))
>>
> You could write this:
>
> if ((P1IFG & P1IE & pinmask) && (port1_isr_tbl[i] != 0))
>
> Every cycle counts, it's easier to read, and P1IFG & P1IE mimics what the
> MSP430 does internally.
>
> Again, just a thought...
>

I'd take it a step further
unsigned int i= 1;
unsigned int j= 0;
for( ; i; i<<= 1, ++j )
{
if( P1IFG & P1IE & i && port1_isr_tbl[ j ] )
[do it];
}

This eliminates an inner loop to do the pinmask= 1 << i; Faster with
less code. The first might get optimized properly where this may not.

But I would be weighing if it is necessary to use a function table,
especially in an interrupt. Maybe if the pin functions need to be
reassigned in the field, but the potential overhead in the wrong
place... Can't say without seeing the whole implementation and just
thinking out loud....

Best, Dan.

------------------------------------



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

Re: problem with msp430f2272 - microbit_ubuntu_9101 - Nov 22 21:12:09 2009

Personally, I've found that (specific to MSP430) least cycles are used
up when using a straight fixed look up table with the 8 bit positions.
The loop holds a pointer to the table, which is incremented at each
iteration. (ie. the loop's "counter" is actually a pointer to
0x01-0x02-0x04-0x08-..etc).

My 20 milli-Dollars :-)

B rgds
Kris

On Sun, 2009-11-22 at 18:26 -0700, Dan Bloomquist wrote:
> Paul Curtis wrote:
> > ...just a quick observation:
> >
> >
> >> __interrupt void port1_ISR(void)
> >> {
> >> register uint8 i;
> >> if (P1IFG)
> >> {
> >> for (i = 0; i < 8 ;i++)
> >> {
> >> register const uint8 pinmask = 1 << i;
> >> if ((P1IFG & pinmask) && (P1IE & pinmask) &&
> >> (port1_isr_tbl[i] != 0))
> >>
> >
> >
> > You could write this:
> >
> > if ((P1IFG & P1IE & pinmask) && (port1_isr_tbl[i] != 0))
> >
> > Every cycle counts, it's easier to read, and P1IFG & P1IE mimics what the
> > MSP430 does internally.
> >
> > Again, just a thought...
> >
>
> I'd take it a step further
> unsigned int i= 1;
> unsigned int j= 0;
> for( ; i; i<<= 1, ++j )
> {
> if( P1IFG & P1IE & i && port1_isr_tbl[ j ] )
> [do it];
> }
>
> This eliminates an inner loop to do the pinmask= 1 << i; Faster with
> less code. The first might get optimized properly where this may not.
>
> But I would be weighing if it is necessary to use a function table,
> especially in an interrupt. Maybe if the pin functions need to be
> reassigned in the field, but the potential overhead in the wrong
> place... Can't say without seeing the whole implementation and just
> thinking out loud....
>
> Best, Dan.
>
> ------------------------------------



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

Re: problem with msp430f2272 - Dan Bloomquist - Nov 22 21:37:27 2009

microbit_ubuntu_9101 wrote:
> Personally, I've found that (specific to MSP430) least cycles are used
> up when using a straight fixed look up table with the 8 bit positions.
> The loop holds a pointer to the table, which is incremented at each
> iteration. (ie. the loop's "counter" is actually a pointer to
> 0x01-0x02-0x04-0x08-..etc).
>
> My 20 milli-Dollars :-)
>

Ha! Thanks, I'll put that in the brain bin. Might be worth billions of
sense! :)

I'll try them both tomorrow and count bytes for fun.

Best, Dan.

------------------------------------



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

Re: problem with msp430f2272 - thuhang - Dec 2 11:14:31 2009


Hi everybody
I have a problem with UART , I use IAR , I writed a UART 's program for
MSP430F2272 , It can transmit a character or number to computer, but it
can't receive a character , number, string . I use MAX3232 3.6V , crytal
16Mhz in my board, and I use Visual Basic to creat interface check my
transmit and my receive . My code follow :
#include // Specific device, new format
header
//#include "msp430x22x2.h"
#include "in430.h"
#include "stdio.h"

//-----------------------------------------------------------------------------
void main(void)
{ int i;
__delay_cycles(2000);
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
BCSCTL1 = CALBC1_1MHZ; // Set DCO
DCOCTL = CALDCO_1MHZ;
P2DIR = 0xFF;
P2OUT = 0xff;
/// truyen len may tinh UART
//------------------------------------------
P3SEL = 0x30; // P3.4,5 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 104; // 1MHz 9600, 16M is 1666, bang
15.4
UCA0BR1 = 0; // 1MHz 9600
UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1, bang
15.4
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state
machine**
IE2 |= UCA0RXIE + UCA0TXIE; // Enable USCI_A0 RX,TX
interrupt

__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts
enabled
}

//-----------------------------------------------------------------------------
#pragma vector=USCIAB0TX_VECTOR
__interrupt void USCI0TX_ISR(void)
{
UCA0TXBUF = 2; // Read, justify, and transmit

//------------------------------------------------------------------------------

}
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
if (UCA0RXBUF == 'A') // 'u' received?
{
for (;;)
{
P2OUT ^= 0x20; // Toggle P1.0 using
exclusive-OR

i = 50000; // Delay
do (i--);
while (i != 0);
}
}
}
My code can transmit a character to computer but I check receive character
'A' to by Led flash In P2.5 of MSP430F2271 .But It 's active
Who can help me with this problem ?
Thank you
thuhang wrote:
>
> I write code for msp430f2272, complier not error, but it 's a error when I
> rebuild all :
> Error[e16]: Segment DATA16_Z (size: 0x80f align: 0x1) is too long for
> segment definition. At least 0x481 more bytes needed. The problem occurred
> while processing the segment placement command
> "-Z(DATA)DATA16_I,DATA16_Z,DATA16_N,DATA16_HEAP+_DATA16_HEAP_SIZE=0200-05FF",
> where
> at the moment of placement the available memory ranges were "CODE:271-5ff"
> Reserved ranges relevant to this placement:
> 200-5ff DATA16_I
> Who can help me with this problem ?
> Thank you
>

--
View this message in context: http://old.nabble.com/problem-with-msp430f2272-tp26409588p26611561.html
Sent from the MSP430 - Discuss mailing list archive at Nabble.com.

------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



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