Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer...
Transcript of Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer...
![Page 1: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/1.jpg)
Institute of Electrical and Electronics Engineers (IEEE)Robotics & Automation SocietyEgypt Chapter
Microcontroller Microcontroller
Types , Programing , Interface
![Page 2: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/2.jpg)
objectiveobjective To make the hardware circuit needed for the
microcontroller To make simple program that blink a LED
![Page 3: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/3.jpg)
Microcontroller sampleMicrocontroller sample
![Page 4: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/4.jpg)
Required components Required components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Batteries Cable AC Resistances Resistances Leds
![Page 5: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/5.jpg)
Required toolsRequired tools Multimeter 5v power source . Wire clipper (optional )pp ( p ) Tweezers (optional)
![Page 6: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/6.jpg)
Types of MicrocontrollersTypes of Microcontrollers PIC (peripheral interface controller) ATMEL AVR Philips TI (Texas instruments ) TI (Texas instruments )
![Page 7: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/7.jpg)
Why we will use PIC ?Why we will use PIC ? It is available in the market It’s Burner (programmer ) is easily available ! Relatively cheap y p Have many aiding and ready made projects on internet !
![Page 8: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/8.jpg)
Choose MicrocontrollerChoose Microcontroller
![Page 9: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/9.jpg)
Comparison between different PIC’sComparison between different PIC s
![Page 10: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/10.jpg)
Pin Configuration of the PIC 16f84aPin Configuration of the PIC 16f84a
![Page 11: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/11.jpg)
Memory typesMemory types
![Page 12: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/12.jpg)
Memory configurationMemory configuration
Reset Vector ( 0000h )When a reset is executed, either by turning power
on, by the WDT (Watchdog Timer) or any other , y ( g ) yfactor,the program will start from this address.Peripheral Interrupt Vector ( 0004h )p p ( )When there is a time-out interruption from the timer (TMR0) or an outside interrupt, the program will start from this address.Configuration word ( 2007h )The basic operation of the PIC is specified at this memory location. The enable bits of the Power-up timer, and the Watch-dog timer as well as the oscillator selection bits are set here.Thi i b hi d h l d This area is behind the usual program area and cannot be accessed by the program. These parametersmust be specified using the burner when burningthe program into flash memory
![Page 13: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/13.jpg)
![Page 14: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/14.jpg)
TimerTimer
The PIC16F84A has only one timer (TMR0, an 8 bit timer). It times out when the count reaches 256 and the TOIF bit of the INCON register of the SFR becomes "1". With a timed out condition it is possible to make an
Th ll h interrupt occur. The interrupt will stop the processing which was in progress at that time. To make the interrupt occur the GIF and the TOIE bits of the INTCON register occur the GIF and the TOIE bits of the INTCON register of the SFR must be set (1)
![Page 15: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/15.jpg)
Main connections for the PICMain connections for the PIC It is organized with the manner of which the connections
will be done Pin 5 : 0 volt Pin 14 : 5 volts Pin15 ,16 : Clock crystal and we should connect 2 * (16 , y (
or 20) pF capacitor Pin 4 : MCLR connected with resistance to 5 Volts
![Page 16: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/16.jpg)
Code for LED blinkingCode for LED blinking
/* this sign means comment / this sign means comment Lab Led blinking*/ bi LED Rb0 bisbit LED at Rb0_bit;
void main() {TRISB = 0b00000000; // PORTB All Outputs TRIS is for assinging the port to
be I/OTRISA = 0b00001000; // RA3 is an inputwhile(1) { // Infinite Loop( ) { pLED = 1;Delay_ms(1000); //built in library to make a delay in milli secondsLED = 0;LED = 0;Delay_ms(1000);}
![Page 17: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/17.jpg)
![Page 18: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/18.jpg)
Software development environmentSoftware development environment MPlab IDE MikroC CCS
![Page 19: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/19.jpg)
MPlabMPlab
![Page 20: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/20.jpg)
MPlabMPlab
Th b i di h i Chi C ll ill b (16f84 16f877 )The number is according to the micro Chip Controller you will buy (16f84a , 16f877a, …. )
![Page 21: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/21.jpg)
MPlabMPlab
![Page 22: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/22.jpg)
MPlabMPlab
![Page 23: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/23.jpg)
Problem of the Line FollowerProblem of the Line Follower
![Page 24: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/24.jpg)
IdeaIdea
![Page 25: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/25.jpg)
IdeaIdea
![Page 26: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/26.jpg)
IdeaIdea
![Page 27: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/27.jpg)
IdeaIdea
![Page 28: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/28.jpg)
Transform the IdeaTransform the Idea
![Page 29: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/29.jpg)
CodeCode
![Page 30: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/30.jpg)
CodeCode
![Page 31: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/31.jpg)
CodeCode
![Page 32: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/32.jpg)
RefrencesRefrences L8-Microcontrollers & Input-output Systems Dr alaa
khamis , Advanced mechatronics subject Roboclub 2011 Slides done by Eng.Amir Roshdy Ali http://tutorial.cytron.com.my/2012/07/03/getting-started-
with-mplabide/ http://www.youtube.com/watch?v=PhJKhV5l-i4 http://www.youtube.com/watch?v=S1QCZW92fU4p y Q
![Page 33: Types , Programing , Interface - Egypt · PDF fileRequired components Pic 16f84a Programmer (burner ) Breaboard Wires Batteries Cable AC Resistances Leds](https://reader034.fdocuments.in/reader034/viewer/2022051507/5a732a507f8b9aac538e53bb/html5/thumbnails/33.jpg)
Waiting your robots to be done and compete …..
For any Questions you can post it on facebook page you can post it on facebook page
(https://www.facebook.com/RoboClub.guc ) or you can send and E-mail on [email protected]