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.
Use of pre-processor defines - ti2tt - Nov 6 10:27:37 2009
Hello Forum members,
I am using CrossStudio v2.0 with MSP430F2418. My project is having different pre-processor
defines which will generate different output files (*.hex). Some defines may be used in
combinations. At present the valid use of these defines is working successfully. How do I
assure that the correct combinations are used and then do the compiling to generate valid
output file?
Your earliest help in this regard will be highly appreciated. Thanks in advance.
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
RE: Use of pre-processor defines - Microbit_P43000 - Nov 10 0:32:59 2009
One easy way is to create new Build Configurations. I don't understand at times why
some
seem to be so focused at using the default 'debug' and 'release' configs only on a per
se
basis.
In the Build menu, you can create new configurations, choose which configs they inherit
from, give those Build Configs more descriptive names, based on the differences in
build
output you want.
Once you've done that, it's just a matter of inserting the right pre-processor defines
in
each respective
Build Config. So while you're coding/debugging, just drop down the new build config,
recompile (the defines will be properly visible to your project and/or solution files).
This will ensure you're using the correct "combinations" of your pre-processor defines.
Remember that you can apply them node-specific, a group of input files, more global,
project wide
Etc etc.
HTH
Best Regards,
Kris
> -----Original Message-----
> From: m...@yahoogroups.com [mailto:m...@yahoogroups.com] On Behalf Of ti2tt
> Sent: Saturday, 7 November 2009 2:27 AM
> To: m...@yahoogroups.com
> Subject: [msp430] Use of pre-processor defines
>
> Hello Forum members,
>
> I am using CrossStudio v2.0 with MSP430F2418. My project is having different
pre-processor
> defines which will generate different output files (*.hex). Some defines may be used
in
> combinations. At present the valid use of these defines is working successfully. How
do
I assure
> that the correct combinations are used and then do the compiling to generate valid
output file?
>
> Your earliest help in this regard will be highly appreciated. Thanks in advance.
>
> ------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Use of pre-processor defines - Dan Bloomquist - Nov 10 1:25:32 2009
Microbit_P43000 wrote:
> One easy way is to create new Build Configurations. I don't understand at times why
some
> seem to be so focused at using the default 'debug' and 'release' configs only on a per
se
> basis.
>
Perhaps, a misunderstanding of these configurations. I had my hand
slapped for repeating what OWC had posted on just this topic some time
back. So, I'm guessing, as this is my background, that some have come
from a VS environment and don't really understand 'why' or 'what'. There
should be no good reason not to build and debug in the most 'optimized'
configuration unless you don't want to be bothered. In the case you
don't want to be bothered, you should understand that moving to
'optimization' may break what you intend. If your compiler has the salt,
this should be somewhat painless, but not necessarily seemless. At that,
if you have lots of time and memory (and battery), who really cares
about optimization!?.
I go there on a box only in the bigger picture. Otherwise, it is a
waste. On the micro, you do want to be considerate, but that doesn't
mean anal if you have the time and memory to get the job done. I have
jobs for the like of the 2013 and have to be just as inefficient as
possible. But the newer stuff, like the 5437, what is the balance?
This stuff requires evaluating the goals of a project and how much time
invested to meet the 'ends'. A balance, if you will.
Best, Dan.
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Use of pre-processor defines - micr...@virginbroadband.com.au - Nov 10 4:41:15 2009
Hi Dan,
I never implied anything about different optimisations ? (although that
should not be as big a problem
as it's made out to be at times IMO).
I merely pointed out one possible way to create/select different configs
through the CrossWorks
GUI, while various preprocessor defines are automatically
defined/undefined, as per OP's question.
The different build configs in this context also provide a 1-2-3 way of
creating one or more proper descriptive
and meaningful names to configs, rather than cryptic ones - or just the
default 'debug' and release'.
It could even just be various configs inherited from the default Debug
Config, but with varying preprocessor
defines and/or undefines.... that's all...
I thought I was quite non-ambiguous, given the nature of the OP's short
but concise question.
I'm not sure what you're referring to vis-a-vis some recent arg & OCY :-)
I've been more in the background recently....
B rgds
Kris
On Mon, 09 Nov 2009 23:23:36 -0700, Dan Bloomquist
wrote:
> Microbit_P43000 wrote:
>> One easy way is to create new Build Configurations. I don't understand
>> at times why some
>> seem to be so focused at using the default 'debug' and 'release'
configs
>> only on a per se
>> basis.
>>
>
> Perhaps, a misunderstanding of these configurations. I had my hand
> slapped for repeating what OWC had posted on just this topic some time
> back. So, I'm guessing, as this is my background, that some have come
> from a VS environment and don't really understand 'why' or 'what'. There
> should be no good reason not to build and debug in the most 'optimized'
> configuration unless you don't want to be bothered. In the case you
> don't want to be bothered, you should understand that moving to
> 'optimization' may break what you intend. If your compiler has the salt,
> this should be somewhat painless, but not necessarily seemless. At that,
> if you have lots of time and memory (and battery), who really cares
> about optimization!?.
>
> I go there on a box only in the bigger picture. Otherwise, it is a
> waste. On the micro, you do want to be considerate, but that doesn't
> mean anal if you have the time and memory to get the job done. I have
> jobs for the like of the 2013 and have to be just as inefficient as
> possible. But the newer stuff, like the 5437, what is the balance?
>
> This stuff requires evaluating the goals of a project and how much time
> invested to meet the 'ends'. A balance, if you will.
>
> Best, Dan.
>
> ------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Use of pre-processor defines - Dan Bloomquist - Nov 10 14:52:22 2009
Hi Kris,
I should have never made it sound like I was challenging your post.
Please accept my apology. I have a broken rib and I'm on drugs,
cantankerous, tired and miserable. :)
But that is no excuse...
Best, Dan.
m...@virginbroadband.com.au wrote:
> Hi Dan,
>
> I never implied anything about different optimisations ? (although that
> should not be as big a problem
> as it's made out to be at times IMO).
> I merely pointed out one possible way to create/select different configs
> through the CrossWorks
> GUI, while various preprocessor defines are automatically
> defined/undefined, as per OP's question.
> The different build configs in this context also provide a 1-2-3 way of
> creating one or more proper descriptive
> and meaningful names to configs, rather than cryptic ones - or just the
> default 'debug' and release'.
> It could even just be various configs inherited from the default Debug
> Config, but with varying preprocessor
> defines and/or undefines.... that's all...
>
> I thought I was quite non-ambiguous, given the nature of the OP's short
> but concise question.
> I'm not sure what you're referring to vis-a-vis some recent arg & OCY :-)
> I've been more in the background recently....
>
> B rgds
> Kris
>
> On Mon, 09 Nov 2009 23:23:36 -0700, Dan Bloomquist
> wrote:
>
>> Microbit_P43000 wrote:
>>
>>> One easy way is to create new Build Configurations. I don't understand
>>> at times why some
>>> seem to be so focused at using the default 'debug' and 'release'
>>>
> configs
>
>>> only on a per se
>>> basis.
>>>
>>>
>> Perhaps, a misunderstanding of these configurations. I had my hand
>> slapped for repeating what OWC had posted on just this topic some time
>> back. So, I'm guessing, as this is my background, that some have come
>> from a VS environment and don't really understand 'why' or 'what'. There
>>
>
>
>> should be no good reason not to build and debug in the most 'optimized'
>> configuration unless you don't want to be bothered. In the case you
>> don't want to be bothered, you should understand that moving to
>> 'optimization' may break what you intend. If your compiler has the salt,
>>
>
>
>> this should be somewhat painless, but not necessarily seemless. At that,
>>
>
>
>> if you have lots of time and memory (and battery), who really cares
>> about optimization!?.
>>
>> I go there on a box only in the bigger picture. Otherwise, it is a
>> waste. On the micro, you do want to be considerate, but that doesn't
>> mean anal if you have the time and memory to get the job done. I have
>> jobs for the like of the 2013 and have to be just as inefficient as
>> possible. But the newer stuff, like the 5437, what is the balance?
>>
>> This stuff requires evaluating the goals of a project and how much time
>> invested to meet the 'ends'. A balance, if you will.
>>
>> Best, Dan.
>>
>> ------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Volatile Problem - SERDAR ARSLAN - Nov 11 10:02:39 2009
Hi I have a Problem with Volatile keyword.
I am using MSP430f427 with LCD driver.
LCDM11 is a LCD register. and it is defined as
volatile unsigned char LCDM11
My code is like following:
LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
disassembly compiler produced is:
LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
00C71E 425E 009B mov.b &LCDM11,R14
00C722 B35E bit.b #0x1,R14
00C724 2C03 jc 0xC72C
00C726 C3D2 009B bic.b #0x1,&LCDM11
00C72A 3C02 jmp 0xC730
00C72C D3D2 009B bis.b #0x1,&LCDM11
BigDelay();
00C730 4030 E6A4 br #0xE6A4
But this assembly code is wrong !!!
After removing volatile problem is solved compiler generates correct code
unsigned char LCDM11
LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
00C71E 425E 009B mov.b &LCDM11,R14
00C722 F07E 000F and.b #0xF,R14
00C726 425F 009B mov.b &LCDM11,R15
00C72A F07F 00F0 and.b #0xF0,R15
00C72E DE4F bis.b R14,R15
00C730 4FC2 009B mov.b R15,&LCDM11
can you say what is the problem about the volatile.
Thanks
Serdar ARSLAN
EAS
------------------------------------
______________________________
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: Volatile Problem - Paul Curtis - Nov 11 10:17:45 2009
Hi,
> Hi I have a Problem with Volatile keyword.
>=20
> I am using MSP430f427 with LCD driver.
> LCDM11 is a LCD register. and it is defined as
> volatile unsigned char LCDM11
>=20
> My code is like following:
>=20
> LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>=20
> disassembly compiler produced is:
>=20
> LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>=20
> 00C71E 425E 009B mov.b &LCDM11,R14
> 00C722 B35E bit.b #0x1,R14
> 00C724 2C03 jc 0xC72C
> 00C726 C3D2 009B bic.b #0x1,&LCDM11
> 00C72A 3C02 jmp 0xC730
> 00C72C D3D2 009B bis.b #0x1,&LCDM11
> BigDelay();
> 00C730 4030 E6A4 br #0xE6A4
>=20
> But this assembly code is wrong !!!
>=20
> After removing volatile problem is solved compiler generates correct code
> unsigned char LCDM11
>=20
> LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>=20
> 00C71E 425E 009B mov.b &LCDM11,R14
> 00C722 F07E 000F and.b #0xF,R14
> 00C726 425F 009B mov.b &LCDM11,R15
> 00C72A F07F 00F0 and.b #0xF0,R15
> 00C72E DE4F bis.b R14,R15
> 00C730 4FC2 009B mov.b R15,&LCDM11
>=20
> can you say what is the problem about the volatile.
The generated code is incorrect in *both* cases. The correct generation fo=
r
this with volatile would be:
mov.b &LCDM11,R15
mov.b &LCDM11,R15
mov.b R15,&LCDM11 ; this line is questionable--it could store anything
and still be correct IMO
And that's the end of it I'm afraid.
--
Paul Curtis, Rowley Associates Ltd=A0=A0 http://www.rowley.co.uk
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: Volatile Problem - SERDAR ARSLAN - Nov 11 10:39:24 2009
Hi
=20
in fact compiler must ignore=20
=20
LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ; line
because this code does nothing. Take left side of LCDM11, and take right si=
de of LCDM11 then logically or ing must always give LCDM11
so compiler must ignore this line (LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & =
0x0F) ; )
=20
if I define LCDM11 as unsigned char LCDM11=20
code looks like correct
=20
CORRECT COMPILATION
LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
mov.b &LCDM11,R14 // put LCDM11 to R14 register
and.b #0xF,R14 // and with 0xF
mov.b &LCDM11,R15 // put LCDM11 to R15 register
and.b #0xF0,R15 // and with 0xF
bis.b R14,R15 // lastly logically OR R14 and R15
mov.b R15,&LCDM11 // put result to LCDM11
but if I define LCDM11 as volatile unsigned char LCDM11
compiler generates wrong code. But I dont know WHY?
=20
WRONG COMPILATION
LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
mov.b &LCDM11,R14
bit.b #0x1,R14
jc 0xC72C
bic.b #0x1,&LCDM11
jmp 0xC730
bis.b #0x1,&LCDM11
br #0xE6A4
=20
=20
Serdar ARSLAN
EAS
=20
To: m...@yahoogroups.com
From: p...@rowley.co.uk
Date: Wed, 11 Nov 2009 15:16:57 +0000
Subject: RE: [msp430] Volatile Problem
=20=20
Hi,
> Hi I have a Problem with Volatile keyword.
>=20
> I am using MSP430f427 with LCD driver.
> LCDM11 is a LCD register. and it is defined as
> volatile unsigned char LCDM11
>=20
> My code is like following:
>=20
> LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>=20
> disassembly compiler produced is:
>=20
> LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>=20
> 00C71E 425E 009B mov.b &LCDM11,R14
> 00C722 B35E bit.b #0x1,R14
> 00C724 2C03 jc 0xC72C
> 00C726 C3D2 009B bic.b #0x1,&LCDM11
> 00C72A 3C02 jmp 0xC730
> 00C72C D3D2 009B bis.b #0x1,&LCDM11
> BigDelay();
> 00C730 4030 E6A4 br #0xE6A4
>=20
> But this assembly code is wrong !!!
>=20
> After removing volatile problem is solved compiler generates correct code
> unsigned char LCDM11
>=20
> LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>=20
> 00C71E 425E 009B mov.b &LCDM11,R14
> 00C722 F07E 000F and.b #0xF,R14
> 00C726 425F 009B mov.b &LCDM11,R15
> 00C72A F07F 00F0 and.b #0xF0,R15
> 00C72E DE4F bis.b R14,R15
> 00C730 4FC2 009B mov.b R15,&LCDM11
>=20
> can you say what is the problem about the volatile.
The generated code is incorrect in *both* cases. The correct generation for
this with volatile would be:
mov.b &LCDM11,R15
mov.b &LCDM11,R15
mov.b R15,&LCDM11 ; this line is questionable--it could store anything
and still be correct IMO
And that's the end of it I'm afraid.
--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
=20=09=09=20=09=20=20=20=09=09=20=20
_________________________________________________________________
Windows Live Hotmail: Your friends can get your Facebook updates, right fro=
m Hotmail=AE.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/so=
cial-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092=
009
[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: Volatile Problem - Paul Curtis - Nov 11 10:45:16 2009
Hi,
> in fact compiler must ignore
>=20
> LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ; line
>=20
> because this code does nothing. Take left side of LCDM11, and take right
> side of LCDM11 then logically or ing must always give LCDM11
That's not actually true; I suggest you take a look at the meaning of
"volatile" in the ISO C stanmds.
> so compiler must ignore this line (LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 =
&
> 0x0F) ; )
No. It *must* read LCDM11 twice and write it once. What it *writes* can b=
e
*anything* because the order of volatile accesses in your right-hand-side i=
s
*undefined* according to the standard.
Given:
volatile unsigned char x;
x =3D x | x;
Then the value of "x" after this statement can be almost anything because
the evaluation order of x | x is undefined.
--
Paul Curtis, Rowley Associates Ltd=A0=A0 http://www.rowley.co.uk
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: Volatile Problem - SERDAR ARSLAN - Nov 11 10:51:37 2009
Hi,
=20
LCDM11 =3D LCDM11 | LCDM11 ;
=20
I Know that when executing this instruction an interrupt can occur and inte=
rrupt can change value of LCDM11=20
and result can be wrong=20
but compiler must generate correct code. Compiler is generating wrong assem=
bly code.
=20
thanks
=20
Serdar ARSLAN
=20
To: m...@yahoogroups.com
From: p...@rowley.co.uk
Date: Wed, 11 Nov 2009 15:43:48 +0000
Subject: RE: [msp430] Volatile Problem
=20=20
Hi,
> in fact compiler must ignore
>=20
> LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ; line
>=20
> because this code does nothing. Take left side of LCDM11, and take right
> side of LCDM11 then logically or ing must always give LCDM11
That's not actually true; I suggest you take a look at the meaning of
"volatile" in the ISO C stanmds.
> so compiler must ignore this line (LCDM11 =3D (LCDM11 & 0xF0) | (LCDM11 &
> 0x0F) ; )
No. It *must* read LCDM11 twice and write it once. What it *writes* can be
*anything* because the order of volatile accesses in your right-hand-side i=
s
*undefined* according to the standard.
Given:
volatile unsigned char x;
x =3D x | x;
Then the value of "x" after this statement can be almost anything because
the evaluation order of x | x is undefined.
--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
=20=09=09=20=09=20=20=20=09=09=20=20
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you=92re up to on=
Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/so=
cial-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092=
009
[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: Volatile Problem - old_cow_yellow - Nov 11 12:24:47 2009
I tried the following with IAR KickStart
#include
void main(void)
{
LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F);
}
With LCDM11 being volatile, I always get:
main:
00800C 425E 009B mov.b &LCDM11,R14
008010 F07E 000F and.b #0xF,R14
008014 425F 009B mov.b &LCDM11,R15
008018 F07F 00F0 and.b #0xF0,R15
00801C DE4F bis.b R14,R15
00801E 4FC2 009B mov.b R15,&LCDM11
008022 4130 ret
With LCDM11 being not volatile, and no optimization, I get the same. But with
optimization, I get instead:
main:
008016 4130 ret
-- OCY
--- In m...@yahoogroups.com, SERDAR ARSLAN wrote:
>
> Hi I have a Problem with Volatile keyword.
>
> I am using MSP430f427 with LCD driver.
> LCDM11 is a LCD register. and it is defined as
> volatile unsigned char LCDM11
>
> My code is like following:
>
> LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>
> disassembly compiler produced is:
>
> LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>
> 00C71E 425E 009B mov.b &LCDM11,R14
> 00C722 B35E bit.b #0x1,R14
> 00C724 2C03 jc 0xC72C
> 00C726 C3D2 009B bic.b #0x1,&LCDM11
> 00C72A 3C02 jmp 0xC730
> 00C72C D3D2 009B bis.b #0x1,&LCDM11
> BigDelay();
> 00C730 4030 E6A4 br #0xE6A4
>
> But this assembly code is wrong !!!
>
> After removing volatile problem is solved compiler generates correct code
> unsigned char LCDM11
>
> LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>
> 00C71E 425E 009B mov.b &LCDM11,R14
> 00C722 F07E 000F and.b #0xF,R14
> 00C726 425F 009B mov.b &LCDM11,R15
> 00C72A F07F 00F0 and.b #0xF0,R15
> 00C72E DE4F bis.b R14,R15
> 00C730 4FC2 009B mov.b R15,&LCDM11
>
> can you say what is the problem about the volatile.
>
> Thanks
>
> Serdar ARSLAN
> EAS
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: Volatile Problem - Dan Bloomquist - Nov 11 13:02:31 2009
old_cow_yellow wrote:
> I tried the following with IAR KickStart
>
> #include
> void main(void)
> {
> LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F);
> }
>
> With LCDM11 being volatile, I always get:
>
> main:
> 00800C 425E 009B mov.b &LCDM11,R14
> 008010 F07E 000F and.b #0xF,R14
> 008014 425F 009B mov.b &LCDM11,R15
> 008018 F07F 00F0 and.b #0xF0,R15
> 00801C DE4F bis.b R14,R15
> 00801E 4FC2 009B mov.b R15,&LCDM11
> 008022 4130 ret
>
> With LCDM11 being not volatile, and no optimization, I get the same. But with
optimization, I get instead:
>
> main:
> 008016 4130 ret
>
>
I get somewhat the same with mspgcc
f836: 1e 42 00 02 mov &0x0200,r14 ;0x0200
f83a: 3e f0 f0 00 and #240, r14 ;#0x00f0
f83e: 1f 42 00 02 mov &0x0200,r15 ;0x0200
f842: 3f f0 0f 00 and #15, r15 ;#0x000f
f846: 0e df bis r15, r14 ;
f848: 82 4e 00 02 mov r14, &0x0200 ;
And it will optimize away only if LCDM11 is 'not' volatile.
Best, Dan.
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Use of pre-processor defines - micr...@virginbroadband.com.au - Nov 11 17:08:09 2009
Hi Dan,
Nah, no worries. I fully appreciate and sympathise -
"been-there-done-that" kinda stuff....!
Just to ensure, I wasn't per se "counterchallenging your challenge"
either.
I just wish to enunciate this, because I followed my opening line with a
question mark.
So, in brief - I wasn't sure whether I was missing something or not, hence
the reason of the terminating ? in :
>> I never implied anything about different optimisations ?
If I felt challenged in a non-constructive way, I'd have been direct
without an implied "please explain further
in case I'm missing something here" qualifier such as a "?" :-)
In the interim I got irritated with a post where I thought there was "safe
margin" (or safe harbor) that benefit of the doubt was not warranted.
In hindsight, perhaps it was warranted after all.... oh well (of course
referring to my sarcasm on the "unit with F169" saga :-)
BUT,
While glancing the more recent posts, the volatile OP one DID start to
annoy, this time with no room for misinterpretation !
I'm off to that thread :-)
Best regards,
Kris
On Tue, 10 Nov 2009 12:52:12 -0700, Dan Bloomquist
wrote:
> Hi Kris,
> I should have never made it sound like I was challenging your post.
> Please accept my apology. I have a broken rib and I'm on drugs,
> cantankerous, tired and miserable. :)
> But that is no excuse...
>
> Best, Dan.
>
> m...@virginbroadband.com.au wrote:
>> Hi Dan,
>>
>> I never implied anything about different optimisations ? (although that
>> should not be as big a problem
>> as it's made out to be at times IMO).
>> I merely pointed out one possible way to create/select different
configs
>> through the CrossWorks
>> GUI, while various preprocessor defines are automatically
>> defined/undefined, as per OP's question.
>> The different build configs in this context also provide a 1-2-3 way of
>> creating one or more proper descriptive
>> and meaningful names to configs, rather than cryptic ones - or just the
>> default 'debug' and release'.
>> It could even just be various configs inherited from the default Debug
>> Config, but with varying preprocessor
>> defines and/or undefines.... that's all...
>>
>> I thought I was quite non-ambiguous, given the nature of the OP's short
>> but concise question.
>> I'm not sure what you're referring to vis-a-vis some recent arg & OCY
:-)
>> I've been more in the background recently....
>>
>> B rgds
>> Kris
>>
>> On Mon, 09 Nov 2009 23:23:36 -0700, Dan Bloomquist
>> wrote:
>>
>>> Microbit_P43000 wrote:
>>>
>>>> One easy way is to create new Build Configurations. I don't
understand
>>>> at times why some
>>>> seem to be so focused at using the default 'debug' and 'release'
>>>>
>> configs
>>
>>>> only on a per se
>>>> basis.
>>>>
>>>>
>>> Perhaps, a misunderstanding of these configurations. I had my hand
>>> slapped for repeating what OWC had posted on just this topic some time
>>> back. So, I'm guessing, as this is my background, that some have come
>>> from a VS environment and don't really understand 'why' or 'what'.
There
>>>
>>
>>
>>> should be no good reason not to build and debug in the most
'optimized'
>>> configuration unless you don't want to be bothered. In the case you
>>> don't want to be bothered, you should understand that moving to
>>> 'optimization' may break what you intend. If your compiler has the
salt,
>>>
>>
>>
>>> this should be somewhat painless, but not necessarily seemless. At
that,
>>>
>>
>>
>>> if you have lots of time and memory (and battery), who really cares
>>> about optimization!?.
>>>
>>> I go there on a box only in the bigger picture. Otherwise, it is a
>>> waste. On the micro, you do want to be considerate, but that doesn't
>>> mean anal if you have the time and memory to get the job done. I have
>>> jobs for the like of the 2013 and have to be just as inefficient as
>>> possible. But the newer stuff, like the 5437, what is the balance?
>>>
>>> This stuff requires evaluating the goals of a project and how much
time
>>> invested to meet the 'ends'. A balance, if you will.
>>>
>>> Best, Dan.
>>>
>>>
>>>
>>> ------------------------------------
>>>
>>>
>>>
>>>

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Volatile Problem - Anders Lindgren - Nov 24 3:16:32 2009
SERDAR ARSLAN wrote:
> Hi I have a Problem with Volatile keyword.
>
> I am using MSP430f427 with LCD driver.
> LCDM11 is a LCD register. and it is defined as
> volatile unsigned char LCDM11
>
> My code is like following:
>
> LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>
> disassembly compiler produced is:
>
> LCDM11 = (LCDM11 & 0xF0) | (LCDM11 & 0x0F) ;
>
> 00C71E 425E 009B mov.b &LCDM11,R14
> 00C722 B35E bit.b #0x1,R14
> 00C724 2C03 jc 0xC72C
> 00C726 C3D2 009B bic.b #0x1,&LCDM11
> 00C72A 3C02 jmp 0xC730
> 00C72C D3D2 009B bis.b #0x1,&LCDM11
> BigDelay();
> 00C730 4030 E6A4 br #0xE6A4
>
> But this assembly code is wrong !!!
Hi Serdar!
This is a known problem, please upgrade to a newer IAR compiler and it
will compile the code just fine.
What happened was that one part of the compiler correctly deducted that
we we reading a consecutive number of bits (just like when reading a bit
field), and anther part of the compiler incorrectly assumed that this
was a one-bit access.
I'm sorry for not spotting your posts until now.
-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.
------------------------------------
______________________________
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 )