embedded systems

S

shan

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
 
W

winnie

if u wanna learn to write embedded software,you'd better buy a book
about it.it is absolutely a systematic project,really!Good luck!
 
A

Antonio Contreras

shan said:
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.
 
Z

Zara

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.

Take a look at MISRA-C (use Google!), it is really interesting.

Best regards

-- Zara
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top