AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf ·...

47
AUTOMATIC CONTROL AUTOMATIC CONTROL SYSTEMS SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting Started with the Code Vision AVR C Compiler In The Name of Allah Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Transcript of AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf ·...

Page 1: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

AUTOMATIC CONTROLAUTOMATIC CONTROLSYSTEMSSYSTEMS

Reference:1. ATMEGA 32 datasheet2. AVR033: Getting Started with the Code Vision AVR C Compiler

In The Name of Allah

Ali KarimpourAssociate Professor

Ferdowsi University of Mashhad

Page 2: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

Lecture 5

The AVR Programming and Simulation

2

Page 3: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

Contents

Code Vision

ProteusThe Proteus provides detailed instructions on how to create new simulator models, using schematic techniques.

Programming a microcontroller through high level language(C)

3

Introduction to AVRSpecially ATMEGA32 (One of the AVR ATMEGA microcontrollers family)

Simple Examples

Page 4: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

4

High-performance, Low-power Atmel®AVR® 8-bit Microcontroller

131 Powerful Instructions – Most Single-clock Cycle Execution

32 × 8 General Purpose Working Registers 32Kbytes of In-System Self-programmable Flash

program memory (W/E: 10,000 times) 1024Bytes EEPROM (W/E: 100,000 times) Data retention: 20 years at 85°C/100 years at 25°C Programming of Flash, EEPROM, Fuses, and

Lock Bits through the JTAG Interface

ATMEGA32 Features

Page 5: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

5

Operating Voltages• – 2.7V - 5.5V for ATmega32L• – 4.5V - 5.5V for ATmega32

Speed Grades• 0 - 8MHz for ATmega32L• 0 - 16MHz for ATmega32

Power Consumption at 1MHz, 3V, 25°C• Active: 1.1mA• Idle Mode: 0.35mA• Power-down Mode: < 1μA

ATMEGA32 Features

Page 6: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

6

Two 8-bit Timer/Counters and one 16-bit Four PWM Channels 8-channel, 10-bit ADC Programmable Serial USART Programmable Watchdog Timer with Separate On-

chip Oscillator On-chip Analog Comparator Internal Calibrated RC Oscillator External and Internal Interrupt Sources Six Sleep Modes: Idle, ADC Noise Reduction, Power-

save, Power-down, Standby and Extended Standby

Page 7: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA 32

ATMEGA32 Peripheral Features

7

One of the most important role of Registers is tuning the application of each unit

Page 8: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

8

Timer/Counter

Page 9: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

9

Timer/Counter

Page 10: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

10

PWM Channel

Page 11: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

11

Programmable Serial USART

Page 12: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

12

Watchdog Timer

Program must reset Watchdog timer before MCU RESET occurring

Page 13: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

13

Interrupt Sources

External Interrupts

Internal Interrupts

Page 14: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

14

External Interrupt Sources

What is the importance of External Interrupts?

Page 15: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

15

Internal Interrupt Sources

What is the importance of Internal Interrupts?

Page 16: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Peripheral Features

16

Sleep Mode

Power-down Mode: < 1μA

Page 17: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Pin Descriptions

17

GND Ground.

VCC Digital supply voltage.

Port B (PB7..PB0) Port B is an 8-bit bi-directional I/O port.

Port A (PA7..PA0) Port A is an 8-bit bi-directional I/O port.

Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port.

Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port.

Page 18: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Pin Descriptions

18

XTAL1 Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.

RESET Reset Input.

AVCC AVCC is the supply voltage pin for Port A and the A/D Converter.

XTAL2 Output from the inverting Oscillator amplifier.

AREF AREF is the analog reference pin for the A/D Converter.

Page 19: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Pin Descriptions

19

ADC0-7

Port A serves as the analog inputs to the A/D Converter.

Port A Pins Alternate Functions

Page 20: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Pin Descriptions

20

XCK/T0T0 (Timer/Counter0 External Counter Input)XCK (USART External Clock Input/Output)

Port B Pins Alternate Functions

T1T1 (Timer/Counter1 External Counter Input)

INT2/AINOAIN0 (Analog Comparator Positive Input)INT2 (External Interrupt 2 Input)

Page 21: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

ATMEGA32 Pin Descriptions

21

PD2INT0 (External Interrupt 0 Input)

Port D Pins Alternate Functions

PD3INT1 (External Interrupt 1 Input)

Page 22: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

22

Code Vision AVRProgramming a microcontroller through high level language(C)

Page 23: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

23

Code Vision AVR

1. Opening Code vision

2. Creating new project

Page 24: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

24

Code Vision AVR

3. Chip selection

4. Clock setting

Page 25: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

25

Code Vision AVR

5. Port setting

- Selecting port

- Input / Output selection (DDRx)

- Pull up / Output value selection(PORTx)

x can be: A / B / C / D

Page 26: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

26

Code Vision AVR

6. External Interrupts setting

- Interrupt Number selection

- Interrupt Mode determination(Low level / Any change / Falling Edge / Rising Edge)

Page 27: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

27

Code Vision AVR

7. Timers setting

- Timer Number selection- Timer or Counter determination

- Timer Frequency determination (CSxx)- Timer Mode determination (WGMxx)

x can be: 0 / 1 / 2

- Timer Interrupt (OCIEx / TOIEx)- Timer Initial Values (TCNTx / OCRx)

Page 28: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

28

Code Vision AVR

8. Serial USART setting

- Serial Dirrection selection- Serial Interrupt enabling (RXCIE / TXCIE)- Serial Baud rate determination (UBRR)- Serial Communication Parametersdetermination (UCSRC)- Serial Mode selection

Page 29: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

29

Code Vision AVR

9. LCD setting

- LCD Port selection

- LCD Selection

- LCD Pin Out explanation

Page 30: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

30

Code Vision AVR

10. Completing the Project

- Save source file

- Save Project file

- Save Code Wizard AVR Project file

Page 31: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

31

Code Vision AVRGenerated Program Save , Compile and

Built ProgramRun the Terminal (Serial) Terminal Setting

Message Window

Template Codes

Page 32: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

32

Code Vision AVR

Generated Program.txt Generated Program.dox Generated Program.pdf

Page 33: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

33

Code Vision AVR

Save , Compile and Built Program

place your code in determinedplaces

Save Compile and Build yourProgram

Information Window shows theoccurred Warnings and Errors

Now The Hex file of your Codeis Generated here:

Project path/Exe/

Page 34: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

34

Proteus 7 ProfessionalThe Proteus provides detailed instructions on how to create new simulator models, using schematic techniques.

Page 35: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

35

Proteus 7 Professional

1. Opening Proteus 1. Opening Proteus. 2. Placing the devices of the circuit. 3. Wiring the circuit. 3. Programming the micro (ATmega32). 4. Adding probes and sensors if needed. 5. Simulating the circuit.

Page 36: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

36

Proteus 7 Professional

Pick new object

Select mode

Wiring mode

Power / GND / etc

More Powers and Generators

Voltage and Current Probes

Seneor and Instrumentation

Run the simulation

Component mode

Page 37: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

37

Proteus 7 ProfessionalYou can search for your device

here

OR find it from the Category

Page 38: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

38

Proteus 7 Professional

Page 39: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

39

Proteus 7 Professional

Some devices that has been used in next examples

Page 40: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

40

Proteus 7 Professional

Page 41: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

41

Simple ExamplesSimple programming and simulation examples

Page 42: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

42

Simple Examples

Example1 Used Blocks: I/O ports

Page 43: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

43

Simple Examples

Example2 Used Blocks: I/O ports Counter0

Page 44: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

44

Simple Examples

Example3 Used Blocks: I/O ports Counter0 PWM2

Page 45: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

45

Simple Examples

Example4 Used Blocks: I/O ports Counter0 PWM2 Interrupt

Page 46: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

46

Simple Examples

Example5 Used Blocks: I/O ports Counter0 PWM2 Interrupt USART

Page 47: AUTOMATIC CONTROL SYSTEMS - Ferdowsi …profsite.um.ac.ir/~karimpor/autocontrol/lec5_aut_con.pdf · AUTOMATIC CONTROL SYSTEMS Reference: 1. ATMEGA 32 datasheet 2. AVR033: Getting

lecture 5

Ali Karimpour, Hamed Moll-Ahmadian Apr 2013

A manual control system with brain microcontroller

47