microcontroller applications elec 421 dr. ron hayne images courtesy of ramesh gaonkar and delmar...

12
Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

Upload: agatha-phelps

Post on 19-Jan-2016

264 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

Microcontroller Applications

ELEC 421

Dr. Ron Hayne

Images Courtesy of Ramesh Gaonkar and Delmar Learning

Page 2: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

Embedded System Typical analog/digital system

TransducerConverts non-electrical signals into electrical signals

A/D converterConverts analog signals into digital signals

Digital processor Processes digital data

D/A converterConverts digital signals into equivalent analog signals

TransducerConverts electrical signals into non-electrical signals

ELEC 330

Page 3: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

PIC18 A/D Converter

ELEC 330

Page 4: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

Pulse Width Modulation

Duty Cycle Percentage ratio of on time of a pulse to its period

Changing of the duty cycle is defined as PWM CCP pin is set as an output Count for period and duty cycle loaded into CCP registers Varying the duty cycle generates PWM

PWM for DC Motor Control Varies average DC voltage Controls DC motor speed

ELEC 330

Page 5: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

PWM Mode

CCP module with Timer2 Output a pulse wave form for a given frequency/duty cycle

Duty cycle CCPR1L register

Period PR2 register

When TMR2 is equal to PR2 TMR2 is cleared Pin RC2/CCP1 of PORTC is set high PWM duty-cycle byte loaded into CCPR1

ELEC 330

Page 6: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

MPLAB X IDE

Compile/Assemble Source Files Linker Script for specific Microcontroller

Test Programs Simulator In Circuit Debugger

PICKit 3

Program Microcontroller PICKit 3

ELEC 330

Page 7: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

PICKit 3

ELEC 330

Page 8: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

PIC18 Explorer Demo Board

ELEC 330

Page 9: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

PIC18F8722

ELEC 330

Page 10: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

2WD Robot Chassis

ELEC 330

Page 11: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

Dual H-Bridge Motor Driver

ELEC 330

Page 12: Microcontroller Applications ELEC 421 Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning

Microcontroller Applications

Analog to Digital Conversion Interface Analog Sensors (Transducers)

Pulse Width Modulation DC Motor Control

MPLAB X IDE Programming and Debugging

PIC18 Explorer Demo Board PIC18F8722 with lots of I/O

Robot Chassis H-Bridge Motor Driver

ELEC 330