Analog I/O in PIC16F877A

12
Lecture 5 : Analog I/O

Transcript of Analog I/O in PIC16F877A

Page 1: Analog I/O in PIC16F877A

Lecture 5 :

Analog I/O

Page 2: Analog I/O in PIC16F877A

Agenda

• Analog Vs Digital • ADC Module • Analog inputs in PIC• Project 1 “Temperature sensor”• Break • PWM Module• Analog output in PIC• Project 2 “ Fan speed control”• Q & A

Page 3: Analog I/O in PIC16F877A

Analog Vs Digital

Analog Signals :- Nature signals which use a continuous range of values to represent information, Like Sound signals.

Digital Signals :- Signals which uses discrete (discontinuous) values to represent information , Like computers.

Page 4: Analog I/O in PIC16F877A

ADC Module

Analog to Digital Converter (ADC) :- is a device that converts a continuous quantity (Voltage) to a digital number that represent the quantity’s amplitude.

Page 5: Analog I/O in PIC16F877A

Analog inputs in PIC

PIC16F877A has 10-bit resolution ADC , with 8 channels.

MikroC functions and commands :-* Void ADC_Init();* Int ADC_Read(Channel number);

Page 6: Analog I/O in PIC16F877A

Project 1 “Temperature Sensor”

Write a program That measure the temperature is the room and the display that temperature on LCD.

Page 7: Analog I/O in PIC16F877A

Break

Page 8: Analog I/O in PIC16F877A

PWM Module

Pulse Width Modulation (PWM) :- is a fancy term for describing a type of digital signal , which is used in many application like controlling Servos and driving RGB LEDs.

Page 9: Analog I/O in PIC16F877A

Analog output in PIC

PIC16F877A has 2 PWM

MikroC Function and Commands :-* Void PWMx_Init(Freq);* Void PWMx_Set_Duty(Duty Cycle)* Void PWMx_Start();* Void PWMx_Stop();

Page 10: Analog I/O in PIC16F877A

Project 2 “Fan Speed Control”

Write a program that control the speed of fan , using variable resistor.

Page 11: Analog I/O in PIC16F877A

Q & A

Page 12: Analog I/O in PIC16F877A

For more Informatin

AZEX team FB Page : https://www.facebook.com/AlAZharEXhibition

Mohamed Ali BedairFB : https://www.facebook.com/MohamedAliBedairMail : [email protected]