This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What is the main difference between Normal C language and IAR C language programming.

What is the main difference between Normal C language and IAR C language programming. 

In terms of programming..???

Is it possible to write all c language programs in IAR for MSP430.

Give some materials if possible..??

Thanks in advance.:D 

  • naresh babu merugu said:
    Is it possible to write all c language programs in IAR for MSP430.

    Yes.

    naresh babu merugu said:
    Give some materials if possible..??

    Go to product webpage, download C source code examples.

  • The language is the same.

    However, there are some things to consider that are beyond the scope of C language.

    This includes hardware interrupts (out-of-order code execution and interrupt vectors), the fact that hardware registers aren't simple variables (reading/writing them might have side-effects and they may unexpectedly change their content) and the fact that the C language doesn't know of processor registers, while some funcitons, especially using hte low-power-modes, require access to processor registers.

    For these specific things, the compiler provides a number of #pragma instructions (to tell that a function is an ISR and not a normal function) and intrinsics (which look like library functions but are directly inlined by the compiler and perform tasks you cannot do in C)

    Those things are covered in the compiler user guide.

    Also, on an MSP (or any microcontroller in general), you don't have unlimited ram/rom/processing power. So while you can use double arithmetics everywhere, you really shouldn't. And a self-written, hand-taylored function is usually better, smaller, faster than using a convenient general-purpose library. Including things like output streams. printf etc.
    And using object-oriented programming, while possible, is usually plain stupid and a waste of resources on a system with a limited heap.

    naresh babu merugu said:
    Is it possible to write all c language programs in IAR for MSP430.

    Write? Yes. Compile? likely. Link? no. Because most of 'all c language programs' will exceed the available flash and ram of the target MSP (and for the free version of IAR, there is also the even more restricting codesize limit)

    But what can be done on an MSP can be done with IAR, or CCS or MSPGCC in C/C++. (except for a few, usually time-critical cases, where the use of assembly or at least inline assembly is recommended or even required)

**Attention** This is a public forum