Presentation is loading. Please wait.

Presentation is loading. Please wait.

MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877.

Similar presentations


Presentation on theme: "MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877."— Presentation transcript:

1 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

2 Why a microcontroller is needed? SensorsMicrocontrollersActuators

3 Variety of microcontrollers Atmel – AT90S8535 Motorola – 68HC11 Intel - 8051 Texas Instruments - Microchip – PIC16F84, PIC16F877

4 Why PIC microcontrollers? Easy to program Better online documantation

5 PIC 16F877

6 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

7 Programming PIC 16F877 Assembler(MPLAB) Basic(Pic Basic Pro) C(HITEC PICC) Parallel port Serial port

8 Minimum circuitry for PIC16F877

9 LED (light emitting diode) flasher LOOP: HIGHPORTB.0 PAUSE500 LOWPORTB.O PAUSE500 GOTOLOOP

10 BUTTON INPUTPORTD.2 LOOP: IF PORTD.2=1 THEN HIGHPORTB.O ELSE LOWPORTB.0 ENDIF GOTOLOOP

11 LCD DEFINE OSC 4 DEFINE LCD_DREG PORTB DEFINE LCD_DBIT 4 DEFINE LCD_RSREG PORTB DEFINE LCD_RSBIT 0 DEFINE LCD_EREG PORTB DEFINE LCD_EBIT 1 DEFINE LCD_BITS 4 DEFINE LCD_LINES 2 DEFINE LCD_COMMANDUS 2000 DEFINE LCD_DATAUS 50 LCDOUT 254,1, "MERHABA" LCDOUT 254,192,"2x16 LCD" END

12 Analog to Digital Conversion Format: 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

13 Pulse Width Modulation Format: HPWM Channel,Dutycycle,Frequency Sample 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

14 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

15 Links www.microchip.comwww.microchip.com (Official website of the PIC manufacturer, PIC16F877 datasheet & some application notes are avaliable) www.antrak.orgwww.antrak.org (Ankara amateur radio society website, biggest pic source in Turkish) www.eproje.comwww.eproje.com (Some applications are avaliable in Turkish) www.picproje.netwww.picproje.net (A discussion forum on PIC microcontrollers in Turkish) www.elektroda.plwww.elektroda.pl (A discussion forum on PIC microcontrollers) robot.metu.edu.trrobot.metu.edu.tr (METU Robot Society website, some tutorials and application notes will be avaliable)


Download ppt "MICROCONTROLLERS Why a microcontroller is needed? Variety of microcontrollers Why PIC microcontrollers? Specificiations of PIC 16F877 Programming PIC 16F877."

Similar presentations


Ads by Google