8051 c programin

3,445 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,445
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
109
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

8051 c programin

  1. 1. By : Ramoliya Biren.
  2. 2. 8051 C Prog Why we are go for c. User define function in c. How it is use for complex programming. What is header file. How to create header file. How to use in main program. By : Ramoliya Biren.
  3. 3. 8051 C Prog It’s easy to program. It can be understand by untether user. Easy with user define function. No deal with registers. Short programing. By : Ramoliya Biren.
  4. 4. 8051 C Prog Simple way of programming.#include<reg51.h>#define variableVoid main(){- - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - -} By : Ramoliya Biren.
  5. 5. 8051 C Prog With the user define function.#include<reg51.h>#define variableFunction_type function_name (variable_typevariable_name){------------------------------------}Void main(){------------------------------------} By : Ramoliya Biren.
  6. 6. 8051 C Prog # What is this symbol.This symbol calls header file.Header file is program which include so manyfunction.This function it use full for deferent things like. port address timer interact register address. By : Ramoliya Biren.
  7. 7. 8051 C ProgCreate your c program. Save it with (header_file_name.h)Now just add three syntax.#ifndef _(header file name)_h#define _(header file name)_h------------------------------------------------------#endif By : Ramoliya Biren.
  8. 8. 8051 C Prog#ifndef _ledb_H#define _ledb_H#include <REGX51.H>void delay(unsigned int time){ unsigned int i,j; for(i=0;i<time;i++) for(j=0;j<1275;j++);}void main(){ while(1) { P1 = 0xff; delay(250); P1 = 0x00; delay(250); }} By : Ramoliya Biren.#endif
  9. 9. 8051 C Prog By : Ramoliya Biren.

×