Presentation is loading. Please wait.

Presentation is loading. Please wait.

Embedded C- Language Lets Learn fundamentals !!. An Embedded system is combination of computer hardware and software, and perhaps additional mechanical.

Similar presentations


Presentation on theme: "Embedded C- Language Lets Learn fundamentals !!. An Embedded system is combination of computer hardware and software, and perhaps additional mechanical."— Presentation transcript:

1 Embedded C- Language Lets Learn fundamentals !!

2 An Embedded system is combination of computer hardware and software, and perhaps additional mechanical or others parts, designed to perform a specific task. An embedded system is a computer system designed to do one or a few dedicated and/or specific functions often with real-time computing constraints Example: microwave oven, AC etc Embedded system

3 Embedded system cont…. Characteristics:- Embedded systems are designed to do some specific task, rather than be a general-purpose computer for multiple tasks. Embedded systems are not always standalone devices. The program instructions written for embedded systems are referred to as firmware, and are stored in read-only memory or Flash memory chips. They run with limited computer hardware resources.

4 What is Embedded C? Embedded C is nothing but a subset of C language which is compatible with certain microcontrollers. Some features are added using header files like,. scanf() and printf() are removed as the inputs are scanned from the sensors and outputs are given to the ports. Control structures remain the same like if- statement, for loop, do-while etc.

5 Development process of Embedded C projects Write C programs in AVR Studio IDE(Integrated Development Environment) Compile them into a.hex file using the AVR-GCC compiler (which integrates into AVR Studio) Simulate the target AVR program and debug the code within AVR Studio Program the actual chip using the USBasp device, which is attached to our target board with a special 6-pin cable Once programmed, the chip runs the program in your circuit

6 If-statement Syntax: if( condition) { statement……. } else { statement…….. }

7 do- while statement Syntax: Initial counter do { statement……. update statement }while(condition);

8 for- statement Syntax: for( initial counter; test condition; update statement) { statement…….. statement……... } Program: for(int i=0;i<5;i++) sprintf(str, “Welcome for training”);

9 Creation of AVR Projects with AVR studio Step-1> Double click on the shortcut file of AVRStudio IDE Step-2 > Press New Project Button for writing an embedded C application

10 Step-2 > Press New Project Button

11 Home screen of AVR STUDIO

12 Step-3 > Select AVR GCC

13 Step-4 > Naming the project Then Click On Next. And Make sure that Create folder check box is always checked.

14 Step-5 > Selecting Platform and Device Then click on Finish.

15 Coding window

16 Building the code Click On Built from the menu bar or press F7.

17 Build Status If there is no error in the code the Build succeeded without any error.

18 Installing the Driver Open the Device Manager window, from the list select the USBasp from LibUSB-Win32Devices. As you double click on USBasp, a window opens. In the Drivers tab click on the Update Driver button, this will give you the option for searching for the driver in the system.

19 Installing the Driver conti… Browse folder of USBasp driver provided in the CD and click on the next It will automatically install the driver This driver will work for 32 bit OS

20 AVR Loader 1.Open the AVR Loader. 2.Select the Microcontroller AT mega8 from the list.

21 AVR Loader conti… 3.In the flash, browse the.hex file of your project which lies in the default folder of your project. 4.Now click on the Write button to burn your program. 5.Make sure that before all these steps of AVR Loader, the programmer should be connected with the system.

22 THANK YOU!!!


Download ppt "Embedded C- Language Lets Learn fundamentals !!. An Embedded system is combination of computer hardware and software, and perhaps additional mechanical."

Similar presentations


Ads by Google