SlideShare une entreprise Scribd logo
1  sur  36
MICROCONTROLLER THE BRAIN
WHAT ARE MICROCONTROLLERS ? A micro-controller (also MCU or µC) is a functional computer system-on-a- chip. It contains a processor core, memory and programmable input/output  peripherals. Micro suggests that the device is small and controller tells you that the device  might be used to control objects, processes or events.  Another term to describe a microcontroller  is embedded controller because  the microcontroller  and its support circuits are often built into or embedded in the devices they control.
WHERE WE USE THEM…???
Basic block diagram of a microcontroller
CPU :  CPU does all the arithmetic and logic operations. It controls the flow of execution of instructions.
RAM ( Random Access Memory) : RAM holds the set of instructions (program), i.e. being executed by the CPU. It holds important data required by the program. It holds some important data structures like ‘stack’. It is volatile in nature.
ROM ( Read Only Memory) : ROM holds very important data and initialization about the microcontroller. It holds the monitor program. It is written by the manufacturer.
Flash Memory : Flash memory is basically EEPROM. It holds the program written by the user. The program can be erased or written here many times. ( Specified by the manufacturer)
I/0 Ports : Every microcontroller has I/O ports. Each port is made up of n-pins ( mostly 8 pins). Each pin can be configured as either input pin or output pin. If a pin is input pin, it accepts data from the device it is connected to. If a pin is output pin, it sends the data to the device it is connected to. Thus these pins form the input/output medium for the microcontrollers.
ADC : Most of the real world signals are analog in nature. But a microcontroller is a digital device, thus it cannot process analog signals. Thus all microcontrollers have built in A-D converters. ADC digitizes an analog signal and gives it to the microcontroller for further processing.
TIMERS : In many applications, time keeping is a must. Eg. If you heating a meal in an oven. Thus microcontrollers have timers to measure time.
SOME COMMON MICROCONTROLLERS  Intel - 8051  Atmel – Atmega 16   PIC  ARM
Question: How a microcontroller works ???  Answer: Microcontroller consists of a Microprocessor (CPU i.e. Central processing Unit) which is interfaced to RAM (Random Access Memory) and Flash Memory (EEPROM). You feed your program in the Flash Memory on the microcontroller. Now when you turn on the microcontroller, CPU accesses the instructions from RAM which access your code from Flash. It sets the configuration of the pins and then start performing according to your program.
Question: How to make the code ?  Answer: You basically write the program on your computer in any of the high level languages like C, C++, JAVA etc. Then you compile the code to generate the machine file.      All the machines understand only one language, 0 & 1 that is on and off. Now this 0 & 1 both corresponds to 2 different voltage levels for example 0 volt for 0 logic and +5 volt for 1 logic. Actually the code has to be written in this 0, 1 language and then saved in the memory of the microcontroller. But this will be very difficult task. So we write the code in the language we understand (eg. C) and then compile and make the machine file “.hex”. After we make this machine file we feed this to the memory of the microcontroller.
Question: How to feed the code in the flash of Microcontroller ?  Answer: Assuming you have the machine file (.hex) ready and now you want to feed that to the flash of the microcontroller. Basically you want to make communication between your computer and microcontroller. Now computer has many communication ports such as Serial Port, Parallel Port and USB (Universal Serial Bus).       Let’s take Serial Port, it has its own definition that is voltage level to define 0 & 1. Serial Port's protocol is called as UART (Universal Asynchronous Receiver & Transmitter). Its voltage levels are : +12 volt for 0 logic and -12 volt for 1 logic.       Now the voltage levels of our microcontroller are based on CMOS (Complementary Metal Oxide Semiconductor) technology which has 0 volt for 0 logic and +5 volt for 1 logic. Two different machines with 2 different ways to define 0 & 1 and we want to exchange information between them. Consider microcontroller as a French and Computer's Serial Port as an Indian person. If they want to exchange information they basically need a mediator who knows both the language. He will listen one person and then translate to other person. Similarly we need a circuit which converts CMOS (microcontroller) to UART (serial port) and vice versa. This circuit is called as programmer. Using this circuit we can connect computer to the microcontroller and feed the machine file to the flash.
ATMEGA 16 MICROCONTROLLER Manufacturer :  ATMEL CORPORATION,         	            USA. http://www.atmel.com/
ATMEGA 16 SPECIFICATIONS :  Advanced RISC Architecture  131 Powerful Instructions – Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers  Up to 16 MIPS Throughput at 16 MHz   16K Bytes of In-System Self-Programmable Flash   512 Bytes EEPROM   1K Byte Internal SRAM   32 Programmable I/O Lines   In-System Programming by On-chip Boot Program   8-channel, 10-bit ADC   Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes   One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture   Four PWM Channels   Programmable Serial USART   Master/Slave SPI Serial Interface   Byte-oriented Two-wire Serial Interface   Programmable Watchdog Timer with Separate On-chip Oscillator   External and Internal Interrupt Sources
PIN CONFIGURATION :
Registers All the configurations in a microcontroller is set through 8 bit (1 byte) locations in RAM (RAM is a bank of memory bytes) of the microcontroller called as Registers.  All the functions are mapped to its locations in RAM and the value we set at that location that is at that Register configures the functioning of microcontroller.  There are total 32 x 8bit registers in Atmega-16. As Register size of this microcontroller is 8 bit, it called as 8 bit microcontroller.
For example :
Digital Input Output Port So let’s start with understanding the functioning of AVR. We will first discuss about I/O Ports. Atmega 16 has 32 I/O (Input/Output) pins grouped as A, B, C & D with 8 pins in each group. This group is called as PORT.   PA0 - PA7 (PORTA)   PB0 - PB7 (PORTB)   PC0 - PC7 (PORTC)   PD0 - PD7 (PORTD)
Data Direction Register, DDRn Determines the direction of individual pins of ports.  If the bit of the DDR is set (1) the corresponding pin of the port is configured as output pin  If the bit of the DDR is cleared (0) the     corresponding pin of the port is configured as     input pin. DDRA = 0xF0;  4 MSB pins of PORTA are output pins  4 LSB pins of PORTA are input pins
Port Pin Register, PINn Reading the input pins of port is done by reading PIN register Temp = PINA; Read the PORTA input and store in temp variable
Port Drive Register, PORTn If the pin is configured as output (DDRn [x] = 1) PORTn register drives the corresponding value on the output pins DDRA = 0xFF; PORTA = 0xF0; Output logic high on 4 MSB pins and logic low on 4 LSB pins
Port Drive Register, PORTn For pins configured as input (DDRn[x] = 0) microcontroller connects a internal pull up resistor if the corresponding bit of PORTn is set  If the PORTn bit is cleared, pin is Tristated  DDRA = 0x00;  PORTA = 0xF0;
Buzzer On / OFF Buzzer is connected to pin 7 of PORT B. Pin is configured as output DDRB= 0x80; To turn on the buzzer output high PORTB = 0x80; To turn off the buzzer output low PORTB = 0x00;
Buzzer Function void Buzzer_ON(void) {   PORTB = 0x80; } void Buzzer_OFF(void) {   PORTB = PORTB & 0x7F; }
Bump Switch  PORTC (0)  Input port DDRC= 0x00;  Internal pull up PORTC = 0x01;  To read inputs portc_copy = PINC
void main(void) { init_devices();    //insert your functional code here...    while(1)                                   //open continuous loop (while)    { portc_copy = PINC;        //read contents of port C into the portc_copy variable      if(portc_copy == 0x01)  //check if any switch is pressed by comparing bitwise with               	                                  //0x01 ('==' comparison)     {        PORTB = 0x00;      //if condition is true turn OFF buzzer by giving PORTB = 0x00     }     else                                      //if condition is false turn ON buzzer to     {                                            //indicate bump switch is pressed by giving PORTB = 0x80        PORTB = 0x80;      }   } }
WALL HUG USING BUMP SWITCHES: PC2 PC3 PC1 PC4 PC0
This is PORTB Pin 0 is connected to LED0. Pin 1 is connected to LED1. Pin 2 is connected to LED2. Pin 3 is connected to LED3. Pin 4 is connected to LED4.
ADC Analog To Digital Converter
Analog To Digital Converter  10 bit resolution  8 channels  PORTA(0 – 7) – (ADC1-ADC7)  Disable internal pull up  ADCH & ADCL – Data Register  ADMUX- Channel Select Register  ADCSR – Control & Status Register
Theory of operation  What we have seen till now that the input given to uC was digital, i.e., either +5 V (logic 1) or 0V (logic 0). But what if we have an analog input. Then we require a tool that converts this analog voltage to discrete values. Analog to Digital Converter (ADC) is such a tool.
Microcontroller

Contenu connexe

Tendances

introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessorsvishi1993
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Mrunal Deshkar
 
Microprocessors and microcontrollers
Microprocessors and microcontrollersMicroprocessors and microcontrollers
Microprocessors and microcontrollersAditya Porwal
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller pptRahul Kumar
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingAnkur Mahajan
 
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )Tarun Khaneja
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O portsanishgoel
 
ATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IVineethMP2
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERsravannunna24
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentationredwan1006066
 
Msp 430 architecture module 1
Msp 430 architecture module 1Msp 430 architecture module 1
Msp 430 architecture module 1SARALA T
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxDr.YNM
 
Introduction to microcontroller
Introduction to microcontrollerIntroduction to microcontroller
Introduction to microcontrollerRajib Roy
 

Tendances (20)

ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessors
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor
 
Microprocessors and microcontrollers
Microprocessors and microcontrollersMicroprocessors and microcontrollers
Microprocessors and microcontrollers
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
8051 Microcontroller ppt
8051 Microcontroller ppt8051 Microcontroller ppt
8051 Microcontroller ppt
 
AVR ATmega32
AVR ATmega32AVR ATmega32
AVR ATmega32
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
 
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
8051 microcontroller lecture ppt by Tarun Khaneja ( 9034406598 )
 
8051 MICROCONTROLLER
8051 MICROCONTROLLER 8051 MICROCONTROLLER
8051 MICROCONTROLLER
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
 
8051 full ppt
8051 full ppt8051 full ppt
8051 full ppt
 
ATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part I
 
LPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLERLPC 2148 ARM MICROCONTROLLER
LPC 2148 ARM MICROCONTROLLER
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
 
ATMEGA 328
ATMEGA 328ATMEGA 328
ATMEGA 328
 
Msp 430 architecture module 1
Msp 430 architecture module 1Msp 430 architecture module 1
Msp 430 architecture module 1
 
Introducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptxIntroducion to MSP430 Microcontroller.pptx
Introducion to MSP430 Microcontroller.pptx
 
Introduction to microcontroller
Introduction to microcontrollerIntroduction to microcontroller
Introduction to microcontroller
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 

En vedette

Introduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIntroduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIslam Samir
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051Rashmi
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR FundamentalsVinit Vyas
 
Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Mahmoud Sadat
 
Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Ganesh Ram
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessorKashyap Shah
 
Human area networks(ad's)
Human area networks(ad's)Human area networks(ad's)
Human area networks(ad's)Ankur Doda
 
Fault identification in transformer winding
Fault identification in transformer windingFault identification in transformer winding
Fault identification in transformer windingeSAT Journals
 
7 segment interface with avr microcontroller
7 segment interface with avr microcontroller7 segment interface with avr microcontroller
7 segment interface with avr microcontrollerKushagra Ganeriwal
 
ARDUINO EMBEDDED SYSTEM
ARDUINO EMBEDDED SYSTEMARDUINO EMBEDDED SYSTEM
ARDUINO EMBEDDED SYSTEMVishal GARG
 
Projects based on atmega controlleer
Projects based on atmega  controlleerProjects based on atmega  controlleer
Projects based on atmega controlleersumit tiwari
 
Microprocessors
MicroprocessorsMicroprocessors
MicroprocessorsSpitiq
 
A.F. Ismail (presentation)
A.F. Ismail (presentation)A.F. Ismail (presentation)
A.F. Ismail (presentation)Elektro_UMBO
 
Basic electronics.rtf
Basic electronics.rtfBasic electronics.rtf
Basic electronics.rtfsagarpiet16
 
2013 IEEE eee hard ware projects
2013 IEEE eee hard ware projects2013 IEEE eee hard ware projects
2013 IEEE eee hard ware projectsVision Solutions
 
T.H. (presentation)
T.H. (presentation)T.H. (presentation)
T.H. (presentation)ElektroUMBO
 

En vedette (20)

Introduction in microcontroller
Introduction in microcontrollerIntroduction in microcontroller
Introduction in microcontroller
 
Introduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIntroduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and Microcontrollers
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
AVR Fundamentals
AVR FundamentalsAVR Fundamentals
AVR Fundamentals
 
Introduction to AVR Microcontroller
Introduction to AVR Microcontroller Introduction to AVR Microcontroller
Introduction to AVR Microcontroller
 
Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))Architecture of 8051 microcontroller))
Architecture of 8051 microcontroller))
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
 
Presentation1 (1)
Presentation1 (1)Presentation1 (1)
Presentation1 (1)
 
Human area networks(ad's)
Human area networks(ad's)Human area networks(ad's)
Human area networks(ad's)
 
Fault identification in transformer winding
Fault identification in transformer windingFault identification in transformer winding
Fault identification in transformer winding
 
Basics of ATmega32
Basics of ATmega32Basics of ATmega32
Basics of ATmega32
 
7 segment interface with avr microcontroller
7 segment interface with avr microcontroller7 segment interface with avr microcontroller
7 segment interface with avr microcontroller
 
ARDUINO EMBEDDED SYSTEM
ARDUINO EMBEDDED SYSTEMARDUINO EMBEDDED SYSTEM
ARDUINO EMBEDDED SYSTEM
 
Projects based on atmega controlleer
Projects based on atmega  controlleerProjects based on atmega  controlleer
Projects based on atmega controlleer
 
Microprocessors
MicroprocessorsMicroprocessors
Microprocessors
 
Lcd & keypad
Lcd & keypadLcd & keypad
Lcd & keypad
 
A.F. Ismail (presentation)
A.F. Ismail (presentation)A.F. Ismail (presentation)
A.F. Ismail (presentation)
 
Basic electronics.rtf
Basic electronics.rtfBasic electronics.rtf
Basic electronics.rtf
 
2013 IEEE eee hard ware projects
2013 IEEE eee hard ware projects2013 IEEE eee hard ware projects
2013 IEEE eee hard ware projects
 
T.H. (presentation)
T.H. (presentation)T.H. (presentation)
T.H. (presentation)
 

Similaire à Microcontroller

Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVRMohamed Abdallah
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051Sadiq Rahim
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontrollerSHILPA Sillobhargav
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copymkazree
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerRup Chowdhury
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.pptAakashRawat35
 
janakiraman egsp collage I msc 4 unit
janakiraman egsp collage  I msc 4 unitjanakiraman egsp collage  I msc 4 unit
janakiraman egsp collage I msc 4 unitjanakiramang6
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basicssagar Ramdev
 
janakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiramang6
 
PIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarPIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarGauravRaikar3
 
PIC introduction + mapping
PIC introduction + mappingPIC introduction + mapping
PIC introduction + mappingOsaMa Hasan
 

Similaire à Microcontroller (20)

Avr microcontroller
Avr microcontrollerAvr microcontroller
Avr microcontroller
 
Presentation
PresentationPresentation
Presentation
 
Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVR
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Microcontroller 8051 gs
Microcontroller 8051 gsMicrocontroller 8051 gs
Microcontroller 8051 gs
 
embedded system and microcontroller
 embedded system and microcontroller embedded system and microcontroller
embedded system and microcontroller
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copy
 
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
Picmico
PicmicoPicmico
Picmico
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.ppt
 
janakiraman egsp collage I msc 4 unit
janakiraman egsp collage  I msc 4 unitjanakiraman egsp collage  I msc 4 unit
janakiraman egsp collage I msc 4 unit
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
 
Assignment
AssignmentAssignment
Assignment
 
janakiraman I msc 4 unit
janakiraman I msc 4 unitjanakiraman I msc 4 unit
janakiraman I msc 4 unit
 
PIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikarPIC 16F877 micro controller by Gaurav raikar
PIC 16F877 micro controller by Gaurav raikar
 
digital clock atmega16
digital clock atmega16digital clock atmega16
digital clock atmega16
 
PIC introduction + mapping
PIC introduction + mappingPIC introduction + mapping
PIC introduction + mapping
 
8051 Presentation
8051 Presentation8051 Presentation
8051 Presentation
 
Iot Workshop NITT 2015
Iot Workshop NITT 2015Iot Workshop NITT 2015
Iot Workshop NITT 2015
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

Microcontroller

  • 2. WHAT ARE MICROCONTROLLERS ? A micro-controller (also MCU or µC) is a functional computer system-on-a- chip. It contains a processor core, memory and programmable input/output peripherals. Micro suggests that the device is small and controller tells you that the device might be used to control objects, processes or events. Another term to describe a microcontroller is embedded controller because the microcontroller and its support circuits are often built into or embedded in the devices they control.
  • 3. WHERE WE USE THEM…???
  • 4. Basic block diagram of a microcontroller
  • 5. CPU : CPU does all the arithmetic and logic operations. It controls the flow of execution of instructions.
  • 6. RAM ( Random Access Memory) : RAM holds the set of instructions (program), i.e. being executed by the CPU. It holds important data required by the program. It holds some important data structures like ‘stack’. It is volatile in nature.
  • 7. ROM ( Read Only Memory) : ROM holds very important data and initialization about the microcontroller. It holds the monitor program. It is written by the manufacturer.
  • 8. Flash Memory : Flash memory is basically EEPROM. It holds the program written by the user. The program can be erased or written here many times. ( Specified by the manufacturer)
  • 9. I/0 Ports : Every microcontroller has I/O ports. Each port is made up of n-pins ( mostly 8 pins). Each pin can be configured as either input pin or output pin. If a pin is input pin, it accepts data from the device it is connected to. If a pin is output pin, it sends the data to the device it is connected to. Thus these pins form the input/output medium for the microcontrollers.
  • 10. ADC : Most of the real world signals are analog in nature. But a microcontroller is a digital device, thus it cannot process analog signals. Thus all microcontrollers have built in A-D converters. ADC digitizes an analog signal and gives it to the microcontroller for further processing.
  • 11. TIMERS : In many applications, time keeping is a must. Eg. If you heating a meal in an oven. Thus microcontrollers have timers to measure time.
  • 12. SOME COMMON MICROCONTROLLERS Intel - 8051 Atmel – Atmega 16 PIC ARM
  • 13. Question: How a microcontroller works ??? Answer: Microcontroller consists of a Microprocessor (CPU i.e. Central processing Unit) which is interfaced to RAM (Random Access Memory) and Flash Memory (EEPROM). You feed your program in the Flash Memory on the microcontroller. Now when you turn on the microcontroller, CPU accesses the instructions from RAM which access your code from Flash. It sets the configuration of the pins and then start performing according to your program.
  • 14. Question: How to make the code ? Answer: You basically write the program on your computer in any of the high level languages like C, C++, JAVA etc. Then you compile the code to generate the machine file. All the machines understand only one language, 0 & 1 that is on and off. Now this 0 & 1 both corresponds to 2 different voltage levels for example 0 volt for 0 logic and +5 volt for 1 logic. Actually the code has to be written in this 0, 1 language and then saved in the memory of the microcontroller. But this will be very difficult task. So we write the code in the language we understand (eg. C) and then compile and make the machine file “.hex”. After we make this machine file we feed this to the memory of the microcontroller.
  • 15. Question: How to feed the code in the flash of Microcontroller ? Answer: Assuming you have the machine file (.hex) ready and now you want to feed that to the flash of the microcontroller. Basically you want to make communication between your computer and microcontroller. Now computer has many communication ports such as Serial Port, Parallel Port and USB (Universal Serial Bus). Let’s take Serial Port, it has its own definition that is voltage level to define 0 & 1. Serial Port's protocol is called as UART (Universal Asynchronous Receiver & Transmitter). Its voltage levels are : +12 volt for 0 logic and -12 volt for 1 logic. Now the voltage levels of our microcontroller are based on CMOS (Complementary Metal Oxide Semiconductor) technology which has 0 volt for 0 logic and +5 volt for 1 logic. Two different machines with 2 different ways to define 0 & 1 and we want to exchange information between them. Consider microcontroller as a French and Computer's Serial Port as an Indian person. If they want to exchange information they basically need a mediator who knows both the language. He will listen one person and then translate to other person. Similarly we need a circuit which converts CMOS (microcontroller) to UART (serial port) and vice versa. This circuit is called as programmer. Using this circuit we can connect computer to the microcontroller and feed the machine file to the flash.
  • 16. ATMEGA 16 MICROCONTROLLER Manufacturer : ATMEL CORPORATION, USA. http://www.atmel.com/
  • 17. ATMEGA 16 SPECIFICATIONS : Advanced RISC Architecture 131 Powerful Instructions – Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Up to 16 MIPS Throughput at 16 MHz 16K Bytes of In-System Self-Programmable Flash 512 Bytes EEPROM 1K Byte Internal SRAM 32 Programmable I/O Lines In-System Programming by On-chip Boot Program 8-channel, 10-bit ADC Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Four PWM Channels Programmable Serial USART Master/Slave SPI Serial Interface Byte-oriented Two-wire Serial Interface Programmable Watchdog Timer with Separate On-chip Oscillator External and Internal Interrupt Sources
  • 19.
  • 20. Registers All the configurations in a microcontroller is set through 8 bit (1 byte) locations in RAM (RAM is a bank of memory bytes) of the microcontroller called as Registers. All the functions are mapped to its locations in RAM and the value we set at that location that is at that Register configures the functioning of microcontroller. There are total 32 x 8bit registers in Atmega-16. As Register size of this microcontroller is 8 bit, it called as 8 bit microcontroller.
  • 22. Digital Input Output Port So let’s start with understanding the functioning of AVR. We will first discuss about I/O Ports. Atmega 16 has 32 I/O (Input/Output) pins grouped as A, B, C & D with 8 pins in each group. This group is called as PORT. PA0 - PA7 (PORTA) PB0 - PB7 (PORTB) PC0 - PC7 (PORTC) PD0 - PD7 (PORTD)
  • 23. Data Direction Register, DDRn Determines the direction of individual pins of ports. If the bit of the DDR is set (1) the corresponding pin of the port is configured as output pin If the bit of the DDR is cleared (0) the corresponding pin of the port is configured as input pin. DDRA = 0xF0; 4 MSB pins of PORTA are output pins 4 LSB pins of PORTA are input pins
  • 24. Port Pin Register, PINn Reading the input pins of port is done by reading PIN register Temp = PINA; Read the PORTA input and store in temp variable
  • 25. Port Drive Register, PORTn If the pin is configured as output (DDRn [x] = 1) PORTn register drives the corresponding value on the output pins DDRA = 0xFF; PORTA = 0xF0; Output logic high on 4 MSB pins and logic low on 4 LSB pins
  • 26. Port Drive Register, PORTn For pins configured as input (DDRn[x] = 0) microcontroller connects a internal pull up resistor if the corresponding bit of PORTn is set If the PORTn bit is cleared, pin is Tristated DDRA = 0x00; PORTA = 0xF0;
  • 27. Buzzer On / OFF Buzzer is connected to pin 7 of PORT B. Pin is configured as output DDRB= 0x80; To turn on the buzzer output high PORTB = 0x80; To turn off the buzzer output low PORTB = 0x00;
  • 28. Buzzer Function void Buzzer_ON(void) { PORTB = 0x80; } void Buzzer_OFF(void) { PORTB = PORTB & 0x7F; }
  • 29. Bump Switch PORTC (0) Input port DDRC= 0x00; Internal pull up PORTC = 0x01; To read inputs portc_copy = PINC
  • 30. void main(void) { init_devices(); //insert your functional code here... while(1) //open continuous loop (while) { portc_copy = PINC; //read contents of port C into the portc_copy variable if(portc_copy == 0x01) //check if any switch is pressed by comparing bitwise with //0x01 ('==' comparison) { PORTB = 0x00; //if condition is true turn OFF buzzer by giving PORTB = 0x00 } else //if condition is false turn ON buzzer to { //indicate bump switch is pressed by giving PORTB = 0x80 PORTB = 0x80; } } }
  • 31. WALL HUG USING BUMP SWITCHES: PC2 PC3 PC1 PC4 PC0
  • 32. This is PORTB Pin 0 is connected to LED0. Pin 1 is connected to LED1. Pin 2 is connected to LED2. Pin 3 is connected to LED3. Pin 4 is connected to LED4.
  • 33. ADC Analog To Digital Converter
  • 34. Analog To Digital Converter 10 bit resolution 8 channels PORTA(0 – 7) – (ADC1-ADC7) Disable internal pull up ADCH & ADCL – Data Register ADMUX- Channel Select Register ADCSR – Control & Status Register
  • 35. Theory of operation What we have seen till now that the input given to uC was digital, i.e., either +5 V (logic 1) or 0V (logic 0). But what if we have an analog input. Then we require a tool that converts this analog voltage to discrete values. Analog to Digital Converter (ADC) is such a tool.