Re: Purchase microcontroller dev. kit
- From: David Brown <david.brown@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Sep 2006 17:55:43 +0200
Nico Coesel wrote:
"David L. Jones" <altzone@xxxxxxxxx> wrote:
try to compile the following on an AVR:
const char a[]={"hello world"}
char b[30];
char *p;
p=a;
strcpy(b,p);
strcat(b, "?");
printf("%s %s", a, b);
It won't work because the different memory areas will screw-up the
pointers. Some very smart and expensive compilers may be able to solve
these problems at the expense of speed.
That works perfectly well using avrgcc. Even on compilers which don't support it directly, the way to deal with code like that is clearly explained in user manuals and FAQs. You weren't suggesting that a beginner should just wade in without looking at the manuals?
Of course, no one doing embedded development on a small microcontroller would write code like that anyway - using printf is a sure sign you don't know what you are doing.
The two most sensible families of small microcontroller for beginners or general use are the AVR and the msp430. There are lots of
AVRs (and lots of development boards), and the peripherals are easy to use. The msp430 is a better fit for C development if you are doing more advanced programming. It also has some more powerful and flexible peripherals, but they are correspondingly more difficult to learn.
Other than that, the choice should be based on availability of local knowledge, books, cards, etc.
Don't worry about non-portability of code. Nothing you write now (as a newbie) will be reused significantly in the future, and all embedded code has at least some layers of non-portable code anyway.
.
- Follow-Ups:
- Re: Purchase microcontroller dev. kit
- From: Nico Coesel
- Re: Purchase microcontroller dev. kit
- References:
- Purchase microcontroller dev. kit
- From: ydoubleuz
- Re: Purchase microcontroller dev. kit
- From: Nico Coesel
- Re: Purchase microcontroller dev. kit
- From: mrdarrett
- Re: Purchase microcontroller dev. kit
- From: Nico Coesel
- Re: Purchase microcontroller dev. kit
- From: Donald
- Re: Purchase microcontroller dev. kit
- From: Nico Coesel
- Re: Purchase microcontroller dev. kit
- From: David L. Jones
- Re: Purchase microcontroller dev. kit
- From: Nico Coesel
- Purchase microcontroller dev. kit
- Prev by Date: Re: Custom USB Cable
- Next by Date: Circuit to simulate PWM?
- Previous by thread: Re: Purchase microcontroller dev. kit
- Next by thread: Re: Purchase microcontroller dev. kit
- Index(es):
Relevant Pages
|