microcontrollers why a microcontroller is needed? variety of microcontrollers why pic...
TRANSCRIPT
![Page 1: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/1.jpg)
MICROCONTROLLERS
Why a microcontroller is needed?
Variety of microcontrollers
Why PIC microcontrollers?
Specificiations of PIC 16F877
Programming PIC 16F877
PIC 16F877 in circuit
Some applications(led,button,lcd,ADC,PWM)
Links
![Page 2: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/2.jpg)
Why a microcontroller is needed?
Sensors
Microcontrollers
Actuators
![Page 3: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/3.jpg)
Variety of microcontrollers
Atmel – AT90S8535
Motorola – 68HC11
Intel - 8051
Texas Instruments -
Microchip – PIC16F84, PIC16F877
![Page 4: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/4.jpg)
Why PIC microcontrollers?
Easy to program
Better online documantation
![Page 5: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/5.jpg)
PIC 16F877
![Page 6: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/6.jpg)
PIC 16F877
8 kbytes of FLASH Program Memory
368 bytes of Data Memory (RAM)
256 bytes of EEPROM Data Memory
33 input or output pins
20 MHz operating speed(200 ns instruction cycle)
Max. 25 mA current from an output pin
![Page 7: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/7.jpg)
Programming PIC 16F877
Assembler (MPLAB)
Basic (Pic Basic Pro)
C (HITEC PICC)
Parallel port
Serial port
![Page 8: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/8.jpg)
Minimum circuitry for PIC16F877
![Page 9: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/9.jpg)
LED (light emitting diode) flasher
LOOP:
HIGH PORTB.0
PAUSE 500
LOW PORTB.O
PAUSE 500
GOTO LOOP
![Page 10: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/10.jpg)
BUTTON
INPUTPORTD.2
LOOP:
IF PORTD.2=1 THEN
HIGH PORTB.O
ELSE
LOW PORTB.0
ENDIF
GOTO LOOP
![Page 11: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/11.jpg)
LCDDEFINE OSC 4 DEFINE LCD_DREG PORTB DEFINE LCD_DBIT 4 DEFINE LCD_RSREG PORTBDEFINE LCD_RSBIT 0DEFINE LCD_EREG PORTBDEFINE LCD_EBIT 1DEFINE LCD_BITS 4DEFINE LCD_LINES 2DEFINE LCD_COMMANDUS 2000 DEFINE LCD_DATAUS 50
LCDOUT 254,1, "MERHABA"LCDOUT 254,192,"2x16 LCD"
END
![Page 12: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/12.jpg)
Analog to Digital ConversionFormat: ADCIN Channel,Var
Sample Program:
ABC VAR BYTE ADCON1 = 2 ' PORTA is analog
INPUT PORTA.0
LOOP: ADCIN PORTA.0,ABC LCDOUT 254,1,#ABC PAUSE 100 GOTO LOOP
![Page 13: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/13.jpg)
Pulse Width ModulationFormat:HPWM Channel,Dutycycle,FrequencySample Program:
DEFINE CCP1_REG PORTC'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
HPWM 1,64,1000
' Send a 25% duty cycle PWM signal at 1kHz
END
![Page 14: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/14.jpg)
Pulse Width Modulation DEFINE CCP1_REG PORTC 'Hpwm 1 pin port DEFINE CCP1_BIT 2 'Hpwm 1 pin bit DUTY VAR BYTE i VAR BYTE DONGU: FOR i=0 TO 255 HPWM 1,DUTY,1000 DUTY=DUTY+1 PAUSE 50 NEXT GOTO DONGU
![Page 15: MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877](https://reader035.vdocuments.us/reader035/viewer/2022081502/551a6ac8550346545e8b5ea9/html5/thumbnails/15.jpg)
Linkswww.microchip.com (Official website of the PIC manufacturer, PIC16F877
datasheet & some application notes are avaliable)www.antrak.org (Ankara amateur radio society website, biggest pic source in
Turkish)www.eproje.com (Some applications are avaliable in Turkish)www.picproje.net (A discussion forum on PIC microcontrollers in Turkish)www.elektroda.pl (A discussion forum on PIC microcontrollers)
robot.metu.edu.tr (METU Robot Society website, some tutorials and application notes will be avaliable)