embedded systems

Discussion in 'C Programming' started by shan, Nov 4, 2005.

  1. shan

    shan Guest

    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
    shan, Nov 4, 2005
    #1
    1. Advertising

  2. shan

    winnie Guest

    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!
    winnie, Nov 4, 2005
    #2
    1. Advertising

  3. 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.
    Antonio Contreras, Nov 4, 2005
    #3
  4. shan

    Zara Guest

    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.

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

    Best regards

    -- Zara
    Zara, Nov 4, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. merodeshpyarocha

    embedded systems...

    merodeshpyarocha, Apr 20, 2004, in forum: Java
    Replies:
    2
    Views:
    352
    chris
    Apr 21, 2004
  2. Mike
    Replies:
    2
    Views:
    610
  3. Replies:
    0
    Views:
    413
  4. news.mot.com
    Replies:
    0
    Views:
    356
    news.mot.com
    Nov 19, 2003
  5. tico_tech

    c++ code for embedded systems

    tico_tech, Apr 14, 2004, in forum: C++
    Replies:
    1
    Views:
    331
    Thorsten Ottosen
    Apr 14, 2004
Loading...

Share This Page