Docsity

Generating PWM-Interfacing Microprocessor-Project Report, Study Guides, Projects, Research of Microprocessor and Interfacing

Partial preview of the text

Download Generating PWM-Interfacing Microprocessor-Project Report and more Study Guides, Projects, Research Microprocessor and Interfacing in PDF only on Docsity!

1

Old way of doing things:

Generating PWM

 D2A conversion using DAC

 PWM using PWM chip and an analog voltage form potentiometer or DAC

2

New way of doing things:

Generating PWM

 How about, no DAC and no PWM IC , and direct PWM

generation from microcontroller without any

Programming overhead, also multi channel support

4

New ways of doing things: A2D

conversion of multiple inputs

 How about, no ADC and no MUX , and directly connect

the analog inputs to microcontroller pins

5

Why upgrade from AT89C51/52 :

Lack of features as compared to other major

microcontroller vendors:

 PWM channels

 Multiplexed ADC channels

 Lower crystal frequencies supported. A maximum of 24 MHZ which actually run the

processor at 2 MHZ due to crystal clock

division by 12

7

Other Widely used 8-bit

Microcontrollers in the world

 In addition to the 8051 compatible chips some other

important 8-bit microcontroller are:

 Motorola, 68HC11 /HC12 series

 Microchip, PIC 12/16/17/18 series

 Atmel AVR series

 Hitachi H8 series ( used in the Lego Mindstorms RCX

brick)

 Parallax Basic Stamp series , (uses mostly PIC

microcontroller)

 These are similar in features but architectures

are different

8

WHY AVR? -

Out of the previously mentioned microcontrollers, Why chose AVR  Relatively low cost, ICs available for 300 to 425 PKR from college RoadDynamic engineer opposite IC master, new shop  Top universities In the world are teaching Motorola, Microchip PIC or Atmel AVR. Although starting point is usually the 8051 or the simplest device of any series.  Atmel AVRStanford(#1 in US), Cornell(# 8), Purdue(#11), Wisconsin Madison(#17) in USAUniversity of Queensland, University of western Australia  Motorola 68HC11/ 68HC  MIT(#2) in USA  UNSW in Australia  And many more  Many other are using PIC and Basic Stamp

Top Engineering Colleges Ranking by graduateshotline.com 2003

10

WHY AVR? -

 Efficient RISC architecture, almost 10 times faster than CISC  For details look into data sheets

 Crystal Clock is not divided and is given directly to the processor.  8051 divides clock by 12  Microchip divides clock by 4  Motorola divides clock by 3  So generally speaking, an AVR running at 16 MHz crystal (Max speed of some AVRs) is equivalent to a 192 MHz 8051 or a 64 MHz PIC or a 36 MHz 68HC11 in general, but variations do exist

 A large and constantly improved family of more than 35 devices divided into three categories, most are available in Pakistan too  ATTINYXX series , 8 to 28 pin devices  AT90SXXXX series (Classic AVR), 20, 28 and 40 pin devices  ATMEGAXXX series , 28, 40 and 64 pin devices

11

WHY AVR? -

 Although the assembly language of AVR is completely

different from 8051, as that of Motorola and Microchip too,

but:

 WINAVR (previously called AVRGCC), A High Quality free

C/C++ compiler is available from the open source (Linux)

community, and it runs in all windows

 As AVR is manufactured by same company i.e. Atmel so the

most direct benefit is that its datasheets are similar to

AT89C51 and easy to follow for students who have studied

AT89C51 datasheets

 Some AVR devices (e.g. AT90S8515) are Pin compatible

to AT89C51 so previously made PCBs (with some minor

modifications) can be used for testing and learning the

AVR architecture and programming

13

WHY AVR? -

 Most AVRs have built-in 10 to 16-bit PWM channels generated

automatically by timers. Number of channels ranges from 2 to 6

 Most AVRs have built-in 10- bit ADC and MUX with number of

channels ranging from 4 to 8

 Large variety of Flash Memory ranging from 1KB to 128 KB

 Large variety of SRAM ranging up to 4 KB

 Built-in EEPROM support up to 4 KB

 I2C and SPI synchronous serial communication for short distance

networking of microcontrollers and other peripherals DACs, ADCs, Flash memory, MP3 decoder ICs etc.

14

What this course is about-

 It’s a Crash Course on AVR microcontroller, but the aim is to introduce you to the latest on chip features/peripherals available on all latest microcontrollers

 There will be 5 lectures

 Lecture  Introduction to AVR features  How to make your starter kit  Installation to relevant software  Using these software  Sample code to test on your starter kit

 Lecture 2  AVR Architecture  WinAVR C programming conventions, and Avrlibc  Interrupt programming  External interrupts

16

Pre-requisites of this course

 Familiarity with AT89C

 AT89C51 assembly & C programming

 AT89C51 extertnal interrupts, timers, UART etc

 AT89C51 Procedure of programming an IC with ez

downloader

 Running the programmed IC on a standard PCB

 Other theoretical knowledge

 Successive approximation register , SAR ADCs

 Basics of PWM

17

PC Hardware requirements

 Any Intel PC

 About 300 MB free space

 Free parallel and serial ports

 Hyper threading P4 computers are found

to cause problem while accessing the

parallel port in WINXP

19

Software on the CD

 All the AVR related software needed for

this course is on the CD

 Make a readme file about softs on the

cd and refer to it here

20

Other Important Issues

 Hyperlinks in this lecture will not open on

your CD as the address of the link would

be changed