Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit containing: ● Processor core (CPU) ● Memory ● Programmable input/output peripherals. ● Program memory ● More . . . Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications. Department of Electronic & Electrical Engineering Applications ● ● ● ● ● ● ● ● ● Car industry Telephones Appliances Cameras Displays Gadgets Remote controls Washing machine STUDENT PROJECTS!!! Department of Electronic & Electrical Engineering Typical Input and output ● Inputs: ● ● ● ● ● Switches Sensors(light,sound,temperature,humidity) Analogue to digital conversion (ADC) LEDs Outputs ● ● ● LCD (displays) DAC (audio signals) Control / Power Electronics Department of Electronic & Electrical Engineering PIC microcontroller Made by Microchip Technology Peripheral Interface Controller We will be using the PIC16F84A. ● ● ● Simple ( 35 instructions RISC ) Cheap ( ~ £3 ) Robust (I haven't broken one yet!!!) Department of Electronic & Electrical Engineering Background reading • The Quintessential PIC (quite advanced) • Many simpler online articles on PIC programing. • Tutorials/links via moodle. Department of Electronic & Electrical Engineering Example: Voltmeter Demo Parallel interface Serial digital 12bits (SPI) LCD display ADC 3.142 Volts PIC Voltage(analogue) Department of Electronic & Electrical Engineering PIC 16F84A pin layout Department of Electronic & Electrical Engineering Summary of pins OSC1/CLKIN : Oscillator crystal input. OSC2/CLKOUT : Oscillator crystal output. MCLR(inv) : Master clear(reset)input. Programming voltage input. RA0 - RA3 RA4/T0CKI RB0/INT RB1 - RB7 : Bi-directional I/O port. : Bi-directional I/O port. Clock input to the TMR0 timer. : Bi-directional I/O port. External interrupt pin. : Bi-directional I/O port. VSS VDD : Ground : Positive supply(+2.0V to +5.5V) Department of Electronic & Electrical Engineering PIC development. Department of Electronic & Electrical Engineering Reset Program/run CLOCK Department of Electronic & Electrical Engineering Department of Electronic & Electrical Engineering Department of Electronic & Electrical Engineering LAB INTRO DEMO Simple example program to light up LED maybe a switch?