Re: Purchase microcontroller dev. kit



Nico Coesel <nico@xxxxxxxxxxx> wrote:
"David L. Jones" <altzone@xxxxxxxxx> wrote:
Nico Coesel wrote:
[snip]
A choice for a CPU should be driven by the question: "What if I want
to move to a different platform". With some platforms the answer to
this question is: "throw away everything you wrote and start over". So
a choice for a platform should be made with great care.
[snip]
Gee that's stange, how on earth have I moved C code almost seamlessly
from a PIC to an AVR to a Rabbit then?

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.

gcc / avr-libc has no trouble whatsoever with that. It doesn't store
strings, even const strings, in "different memory areas" unless you
explicitly tell it to. If you do decide to store some data only in
program space (flash) then avr-libc provides handy functions (like
printf_P) which work directly with data in flash, and functions to copy
data from flash to RAM. Doing that isn't directly portable, but it's
entirely optional and it's not hard to port if you do do it.

If your compiler and libraries don't offer similar facilities, or make
optimisations which break standard C, that's a problem with your choice
of tools or the way you're using them. It is not a problem with the AVR
architecture.


Tim
.



Relevant Pages

  • Re: AVR compilers
    ... > gcc for AVR ... possible to put all the steps - compile, link and flash - in your ... gcc variant I've ever built and used. ...
    (comp.arch.embedded)
  • Re: TFAT stability
    ... you can see that disk-like 512-byte sectors are mapped plain linearly to flash memory. ... TFAT knows nothing of flash blocks. ... We have turned off AutoScan and the platform seems to be stable. ... I think the filesystem moust be unmounted during ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Problem Cloning PUBLIC directory
    ... you must remove the feature from your platform and ... rebuild, otherwise, the binaries from the old PUBLIC atadisk driver still ... >I fixed the SOURCES file and now everything compiles correctly. ... >>> PlatformBuilder 5.0 and having some problems getting it to compile. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Vexille
    ... Heck, if you're stateside, there's Cingular Video and Verizon's ... And then you wouldn't have flash video. ... particular platform, I personally don't think FlashLite is ready yet - ... in all browsers and still deliver what users (and clients; ...
    (rec.arts.anime.misc)
  • Re: how to detect the compile is 32 bits or 64 bits?
    ... determined by whether you have a 32- or 64-bit platform. ... Suppose I have an algorithm, such as a cryptography algorithm, that ... but the chunk size differs for the two cases. ... available at compile time increases compiler optimization opportunities ...
    (comp.lang.c)

Loading