EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

C- Programming for ARM Microcontrollers

Started by tech...@gmail.com October 23, 2006
CBFalconer wrote:
> Tom Lucas wrote: > >> <http://www.amazon.com/exec/obidos/ASIN/0750676094/zws-20> > > > > BTW, chalk up another sale. I ordered "So you wanna" from Amazon > > on Friday. Only GBP16.49 at the moment as well so I'm glad I > > didn't buy the one at ESS that they wanted 21 for. > > That is about 30 USD or less, and quite attractive. So I checked > the link Amazon, and they want about 60 USD for it. What goes on?
Were you looking at the same book? My link above is to my _first_ book. Tom is talking about pricing on my _third_ book <http://www.amazon.com/exec/obidos/ASIN/0750679530/zws-20>. Amazon (US) currently lists my third book at $39.95, at least when I look at the page. The first book included a CD-ROM, and the third book doesn't; this accounts for some of the difference in recommended price. However Amazon is like an airline; prices seem to change almost daily, and I can't fathom how or why.
techie.embedded@gmail.com wrote:
> Can someone point me to some C- Programming Tutorials for ARM7 > Microcontrollers???
ARM website is a good place to look: <URL:http://www.arm.com/documentation/Application_Notes/index.html> Reach for "App Note 34: Writing Efficient C for ARM" Vadim Barshaw
hello members.

thanks for the last... The ARM Application Notes, i guess should serve
my purpose.

Just another question. Does the syntax of code change when programming
in a IAR enviorment to a Keil Environment????

thanks

krish
Vadim Barshaw wrote:
> techie.embedded@gmail.com wrote: > > Can someone point me to some C- Programming Tutorials for ARM7 > > Microcontrollers??? > > ARM website is a good place to look: > <URL:http://www.arm.com/documentation/Application_Notes/index.html> > > Reach for "App Note 34: Writing Efficient C for ARM" > > Vadim Barshaw
techie.embedded@gmail.com wrote:
> hello members. > > thanks for the last... The ARM Application Notes, i guess should serve > my purpose. > > Just another question. Does the syntax of code change when programming > in a IAR enviorment to a Keil Environment????
If you are foolhardy enough to use compiler extensions, yes. If you are disciplined enough to stick to standard C, no. It is quite easy to isolate the portions that require non C defined solutions (interrupts etc...) and provide that in an easy to port fashion. It really helps here to have a static analyzer to keep you an the straight and narrow although some (most?) compilers will complain about their own extensions if placed in a strictly compliant mode. Robert
In article <1161784387.593457.189290@h48g2000cwc.googlegroups.com>, 
Robert Adsett <sub2@aeolusdevelopment.com> writes
> >techie.embedded@gmail.com wrote: >> hello members. >> >> thanks for the last... The ARM Application Notes, i guess should serve >> my purpose. >> >> Just another question. Does the syntax of code change when programming >> in a IAR enviorment to a Keil Environment???? > >If you are foolhardy enough to use compiler extensions, yes. > >If you are disciplined enough to stick to standard C, no.
Please explain what you mean by standard C -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Chris Hills wrote:
> Robert Adsett <sub2@aeolusdevelopment.com> writes >> techie.embedded@gmail.com wrote: >>
... snip ...
>>> >>> Just another question. Does the syntax of code change when >>> programming in a IAR enviorment to a Keil Environment???? >> >> If you are foolhardy enough to use compiler extensions, yes. >> >> If you are disciplined enough to stick to standard C, no. > > Please explain what you mean by standard C
A C system that adheres to the ISO C standard as described in: <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf> or n869.txt (same location) or earlier C standards generally known as C89, C90, C95. Surely you were aware of this. -- Chuck F (cbfalconer at maineline dot net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net>
In article <1161598897.085384.166750@b28g2000cwb.googlegroups.com>, 
"techie.embedded@gmail.com" <techie.embedded@gmail.com> writes
>hi > >Can someone point me to some C- Programming Tutorials for ARM7 >Microcontrollers???
Http://www.sevensandnines.com is a web site (run by IAR) which as a LOT of link and resources from many places, not just IAR. It even has links to Keil! It has a forum but as ever my view is use comp.arch.embedded. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <45437504.86B3644E@yahoo.com>, CBFalconer 
<cbfalconer@yahoo.com> writes
>Chris Hills wrote: >> Robert Adsett <sub2@aeolusdevelopment.com> writes >>> techie.embedded@gmail.com wrote: >>> >... snip ... >>>> >>>> Just another question. Does the syntax of code change when >>>> programming in a IAR enviorment to a Keil Environment???? >>> >>> If you are foolhardy enough to use compiler extensions, yes. >>> >>> If you are disciplined enough to stick to standard C, no. >> >> Please explain what you mean by standard C > >A C system that adheres to the ISO C standard as described in: > > <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf>
That document is NOT "Standard C" It is a Committee Draft. If you tell me it is "close enough" then so is ANY compiler implementation. You can't have it both ways.
>or n869.txt (same location)
Niether is that the C standard...
>or earlier C standards generally known >as C89, C90, C95.
SO your definition is "any of the documents that are or were ISO or US C standards going back over the last 25 years and/or any of the CD's TC's etc etc that are also produced by WG14 even if they are mutually exclusive. That is one hell of a mess..... You are FAR better to adhere to what the compiler does. Yes you should try and group the extensions separately but in embedded
>Surely you were aware of this.
As a longstanding member of the ISO C panel I know what the C standard is and just as importantly what it is not. "Close enough" is OK for horse shoes and hand grenades NOT for programming. Things change in C from year to year. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Chris Hills wrote:
> In article <1161784387.593457.189290@h48g2000cwc.googlegroups.com>, > Robert Adsett <sub2@aeolusdevelopment.com> writes > > > >techie.embedded@gmail.com wrote: > >> hello members. > >> > >> thanks for the last... The ARM Application Notes, i guess should serve > >> my purpose. > >> > >> Just another question. Does the syntax of code change when programming > >> in a IAR enviorment to a Keil Environment???? > > > >If you are foolhardy enough to use compiler extensions, yes. > > > >If you are disciplined enough to stick to standard C, no. > > > Please explain what you mean by standard C
ANSI/ISO. It probably makes sense to stick to C89 for true portability between compilers at the moment. Consider it shorthand for avoiding compiler specific extension, pragmas, inline assembler, interrupt keywords etc..., etc... Robert
In article <1162076665.038472.168090@e64g2000cwd.googlegroups.com>, 
Robert Adsett <sub2@aeolusdevelopment.com> writes
> >Chris Hills wrote: >> In article <1161784387.593457.189290@h48g2000cwc.googlegroups.com>, >> Robert Adsett <sub2@aeolusdevelopment.com> writes >> > >> >techie.embedded@gmail.com wrote: >> >> hello members. >> >> >> >> thanks for the last... The ARM Application Notes, i guess should serve >> >> my purpose. >> >> >> >> Just another question. Does the syntax of code change when programming >> >> in a IAR enviorment to a Keil Environment???? >> > >> >If you are foolhardy enough to use compiler extensions, yes. >> > >> >If you are disciplined enough to stick to standard C, no. >> >> >> Please explain what you mean by standard C > >ANSI/ISO.
Any of the version since 1989? The last poster included "all versions" and the committee drafts etc... Even where they are mutually exclusive.
>It probably makes sense to stick to C89 for true portability >between compilers at the moment.
You probably mean ISO C90, C89 is a local US standard. In any event most are at C95/6 + "some bits" of C99
>Consider it shorthand for avoiding compiler specific extension, >pragmas, inline assembler, interrupt keywords etc..., etc...
However...... Depending on what you are programming and what if any portability is required often you are better sticking with a compiler implementation than the C standard. For example on 8051 most (80%) of the code adheres to the Keil C51 (and there are far more 51's out there than anything else) for PIC it makes sense to use the a common PIC compiler. On PC's of course you follow the MS "standard" or the ECMA Standards Pure ISO C is only a starting point and I say this as a member of both the ISO and MISRA C panels. In real world SW engineering portability is NOT a priority for the vast majority of systems An embedded system is part of something else. No one (bar developers) buys an "embedded system" they buy a clock, camera, car, microwave oven etc. As such the cost of the embedded system in the product has to be minimised. That is the smallest tightest code using the smallest MCU they can get away with the least memory and power consumption. By the time they are looking at changing MCU it is because marketing want the device to do a lot more in different ways (often with a new or different MMI) which usually requires a of the majority of the code will be new anyway. However C code should always be written in a modular style and it does make sense to try an encapsulate areas where you talk to the hardware or use some extensions. Other extensions you will have no choice about. For example on the 8051 placing variables in to Data, BDATa, XData etc Embedded SW Engineering is about pragmatically using the right tools for the job. Not being religious. Incidentally using pure ISO C would mean not using Linux...... It requires GCC extensions to compile it. However I don't see anyone complaining that Linux is not portable. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

The 2024 Embedded Online Conference