24
03/28/1436 1 AVR Programming in C University of Kashan Faculty of Electrical and Computer Engineering Department of Computer Engineering Hossein Sabaghian-Bidgoli [email protected] Fall 2014 Lecture note 8 سی برنامه نویAVR با زبانC University of Kashan Microprocessors 2 ه اسمبلی؟ت ب نسبای آن مزای سی به زبان برنامه نویC راستت راحت گیرد میان کمتری زم ر استدن آن آسان ت تغییر دا ستفاده کردده ای آمانهابع کتابخا میتوان از توا دیگرروکنترلرهای میکمه برای برناز همان جزئی میتوان اغییراتی و با ت براحتستفاده کرد ا ن اسمبلیت به زبا نسب معایب آن ی نهای کدماشینی تر شدنن طوC بیشترحافظهشغال فضای ا ی برنامهد تر شدن اجرا کن

C نابز اب AVR یسیون همانرب

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

PowerPoint PresentationDepartment of Computer Engineering
University of Kashan Microprocessors 2
C
C

University of Kashan Microprocessors 3
CodeVisionAVR WinAVR Include AVR Studio Wizard
CodeVisionAVR
University of Kashan Microprocessors 4
#include < .h> ; ; int main(void) {
; ; while(1) { ; } return 0; }
; { } . // /* */

03/28/1436
3
University of Kashan Microprocessors 5
( )
-( ) - (SRAM EEPROM Flash)
CodeVision float f; eeprom char b; flash int a;
7
03/28/1436
4
7
03/28/1436
5
7
03/28/1436
6
7
03/28/1436
7
7
03/28/1436
8
7
03/28/1436
9

03/28/1436
10
7
03/28/1436
11
7
03/28/1436
12
7
03/28/1436
13
7
03/28/1436
14
7
03/28/1436
15
7
03/28/1436
16
7
03/28/1436
17
7
03/28/1436
18
7
03/28/1436
19
7
03/28/1436
20
7
03/28/1436
21

University of Kashan Microprocessors 42
Some function defined in stdlib.h
Other include files #include <math.h> #include <stdio.h> #include <string.h>
03/28/1436
22
LCD
LCD
03/28/1436
23
LCD
#include <AVR/IO.h>
#include <util/delay.h>
main(){
DDRC=0xff;
DDRD=0xff;
while(1);