embedded systems

Hi to everybody,
what are the concepts that should be learnt in
c to write a embedded software.C is more powerful to handle hardware
but embedded softwares are often written in assembly language ,why ?

Advertisements

Advertisements

shan wrote:
> Hi to everybody,
> what are the concepts that should be learnt in
> c to write a embedded software.

Learn the whole of it. At the very least it won't hurt, and you'll find
it useful if you have to develop some aplication over a PC or a
workstation.

That, said, in embedded systems you're not very likely to use
dinamically allocated memory. You will still use pointers a lot to pass
references arround, but those pointers will usually point to statically
allocted objects (the implementation I'm working with right now doesn't
even support calls to malloc() ).

If you work with small microcontrollers, memory will be at a price, so
you'll end up using bitfields a lot.

Finally, every C compiler for microcontrollers that I've come across
was non conformant in one way or the other. After you learn C, read the
documentation for your compiler, and learn about extensions and
discrepancies with the standard. In 8bit microcontrollers it's usual
for integral constants not to be of type int if they fit in a smaller
type, or to perform arithmetic operation at the precission of the
largest operators (so two chars will not be conveted to int and back as
is usually done). There are also usually extensions for specifying in
which memory location will an object be stores (to allow for maping I/O
registers to be mapped to variables).
> C is more powerful to handle hardware
> but embedded softwares are often written in assembly language ,why ?

I disagree. Assembler offers total control over the machine (not that
this is necessarily a good thing), so it could be said to be more
powerful than anything else.

Anyway, I've worked in a few projects that requiered developing
firmware for some or other embedded system and for the most part they
were developed in C. Only interrupts with tight timing requirements
were written directly in assembler.

On 4 Nov 2005 03:15:43 -0800, "shan" <> wrote:
>Hi to everybody,
> what are the concepts that should be learnt in
>c to write a embedded software.C is more powerful to handle hardware
>but embedded softwares are often written in assembly language ,why ?
>
>Thanks in advance

I do wtite embedded sw in a C/C++/ASM mix that might condemn me to
hell for all eternity. Bit it works.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!