0% found this document useful (0 votes)
68 views

Module1 Embedded C

Embedded C is similar to basic C programming but is used to write code for microcontrollers. It allows the use of loops, arrays, pointers, and functions. While it is easier to modify, understand, and port than assembly language, embedded C code requires more memory and runs slower than assembly. Declaration in embedded C involves specifying registers like ports using the sfr keyword and addresses.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

Module1 Embedded C

Embedded C is similar to basic C programming but is used to write code for microcontrollers. It allows the use of loops, arrays, pointers, and functions. While it is easier to modify, understand, and port than assembly language, embedded C code requires more memory and runs slower than assembly. Declaration in embedded C involves specifying registers like ports using the sfr keyword and addresses.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Embedded C

5/19/15

BICARD

N. P. PAWAR

Disadvantages of Assembly
Language
Difficult

to Modify it need to read


complete Instruction set &
Architecture of the Specific
Microcontroller
Code Difficult to Understand
When other person from different
Engineering Department
Difficult for Porting the Code
Advantage- It is faster than
Embedded C
5/19/15

BICARD

N. P. PAWAR

It

is works like Basic C programming but it


is used for to write the code for Embedded
Microcontroller or Processors so it is called
Embedded C.
We can used same loop, Arrays, Pointers,
Functions & Preprocessor Directives.
But little change in pin configuration & the
header files
For eg. In case of 8051 it need to add
reg51.h header file instead of the stdio.h

5/19/15

BICARD

N. P. PAWAR

Advantages of Embedded
C
Easy

to Portable
Easy to Modify
Easy to Understand the Code
Easy to used same code for other
Microcontroller
Disadvantage
Execution is slower
It Required More Memory
5/19/15

BICARD

N. P. PAWAR

Declaration in Embedded C

Example

8051 Microcontroller
For Port = sfr led=0x80
sfr=special function register
led =variable name
0x80 = Port 0 address
we can use same if,if-else,while,dowhile loops but for loop can be use like
this
for(i=0;i<100;i++);
5/19/15

BICARD

N. P. PAWAR

You might also like