Search code examples
cembedded8051keilgnu-toolchain

Embedded, Is it not possible to compile PIC controller using AVR/8051 compiler


How can I compile a different micro-controller on different micro-controller family IDE/compiler.

For example, I have 8051 keil uVision IDE. I need to compile the code for PIC or AVR controller. Is it possible, by changing any internal settings in the IDE? Or by adding Controller specific header files etc.?

The Actual answer i required here is,

what the IDE/compiler will add to the code after selecting a particular "Microcontroller" in device list of keil or AVR Studio or PIC etc..?


Solution

  • what the IDE/compiler will add to the code after selecting a particular "Microcontroller" in device list of keil or AVR Studio or PIC etc..?

    You are getting it wrong. Let's take a different approach:

    Think of a C program as a specification for your processor i.e description in human readable language how it should perform sequentially.

    Now each processor has different Hardware architecture and different set of instructions to control it.

    Normally ,a C compiler will convert the C Code into Assembly (.asm/.a) instructions specified for that particular processor.

    So a C Compiler for different architectures is along-together a different compiler.

    In Eclipse or IAR tool-chain you use a different compilers for different processors.