SlideShare a Scribd company logo
MICROCONTROLLERTHE 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 embeddedin 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 MICROCONTROLLERManufacturer :  ATMEL CORPORATION,         	            USA.http://www.atmel.com/
ATMEGA 16 SPECIFICATIONS : Advanced RISC Architecture 131 Powerful Instructions – Most Single-clock Cycle Execution32 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 :
Microcontroller
RegistersAll 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 PortSo 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, DDRnDetermines 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, PINnReading the input pins of port is done by reading PIN registerTemp = PINA;Read the PORTA input and store in temp variable
Port Drive Register, PORTnIf the pin is configured as output (DDRn [x] = 1) PORTn register drives the corresponding value on the output pinsDDRA = 0xFF;PORTA = 0xF0;Output logic high on 4 MSB pins and logic low on 4 LSB pins
Port Drive Register, PORTnFor 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 / OFFBuzzer is connected to pin 7 of PORT B.Pin is configured as outputDDRB= 0x80;To turn on the buzzer output highPORTB = 0x80;To turn off the buzzer output lowPORTB = 0x00;
Buzzer Functionvoid Buzzer_ON(void){  PORTB = 0x80;}void Buzzer_OFF(void){  PORTB = PORTB & 0x7F;}
Bump Switch PORTC (0) Input portDDRC= 0x00; Internal pull upPORTC = 0x01; To read inputsportc_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:PC2PC3PC1PC4PC0
This is PORTBPin 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.
ADCAnalog 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

More Related Content

PDF
Introduction to Microcontroller
PPT
E.s unit 6
PPT
Interfacing 8255
PDF
Memory interfacing of microprocessor 8085
PPTX
Memory interfacing
PPTX
8051 MICROCONTROLLER ARCHITECTURE.pptx
PPTX
Subroutine in 8051 microcontroller
PDF
Keypad Interfacing with 8051 Microcontroller
Introduction to Microcontroller
E.s unit 6
Interfacing 8255
Memory interfacing of microprocessor 8085
Memory interfacing
8051 MICROCONTROLLER ARCHITECTURE.pptx
Subroutine in 8051 microcontroller
Keypad Interfacing with 8051 Microcontroller

What's hot (20)

PPTX
8051 memory
PPTX
ARM Processors
PDF
Unit III ARM Interface and ARM Programming
PPTX
8051 Microcontroller PPT's By Er. Swapnil Kaware
PPTX
Architecture of 8051
PPTX
Pic microcontroller architecture
PDF
8051 Microcontroller I/O ports
PPTX
Microcontroller presentation
PPTX
Microcontroller 8051 and its interfacing
PPT
Introduction to microprocessor
PPTX
Embedded system
PPTX
Programmable peripheral interface 8255
DOCX
Embedded System
PPTX
Target hardware debugging
PDF
ARM CORTEX M3 PPT
PPT
PIC timer programming
PDF
Unit 2 mpmc
PPTX
I/O port programming in 8051
PPTX
Embedded system
PPT
Sensors and actuators
8051 memory
ARM Processors
Unit III ARM Interface and ARM Programming
8051 Microcontroller PPT's By Er. Swapnil Kaware
Architecture of 8051
Pic microcontroller architecture
8051 Microcontroller I/O ports
Microcontroller presentation
Microcontroller 8051 and its interfacing
Introduction to microprocessor
Embedded system
Programmable peripheral interface 8255
Embedded System
Target hardware debugging
ARM CORTEX M3 PPT
PIC timer programming
Unit 2 mpmc
I/O port programming in 8051
Embedded system
Sensors and actuators
Ad

Viewers also liked (20)

PPTX
Microcontroller presentation
PPTX
INTRODUCTION TO MICROCONTROLLER
PDF
Introduction in microcontroller
PPTX
Introduction to Embedded Systems and Microcontrollers
PPT
Microcontroller 8051
PPT
AVR Fundamentals
PPTX
Introduction to AVR Microcontroller
PPT
Architecture of 8051 microcontroller))
PPT
8051 MICROCONTROLLER
DOC
8051 Microcontroller Notes
PPTX
Presentation1 (1)
PPTX
Human area networks(ad's)
PDF
Fault identification in transformer winding
PPTX
Basics of ATmega32
PPTX
7 segment interface with avr microcontroller
DOCX
ARDUINO EMBEDDED SYSTEM
PDF
Projects based on atmega controlleer
PPTX
Microprocessors
PPT
Lcd & keypad
PDF
A.F. Ismail (presentation)
Microcontroller presentation
INTRODUCTION TO MICROCONTROLLER
Introduction in microcontroller
Introduction to Embedded Systems and Microcontrollers
Microcontroller 8051
AVR Fundamentals
Introduction to AVR Microcontroller
Architecture of 8051 microcontroller))
8051 MICROCONTROLLER
8051 Microcontroller Notes
Presentation1 (1)
Human area networks(ad's)
Fault identification in transformer winding
Basics of ATmega32
7 segment interface with avr microcontroller
ARDUINO EMBEDDED SYSTEM
Projects based on atmega controlleer
Microprocessors
Lcd & keypad
A.F. Ismail (presentation)
Ad

Similar to Microcontroller (20)

PPTX
Micro Controllers engineering - computer engineering
PPT
Avr microcontroller
PPTX
MICRO_CONTROLLER PRACTICE1_Programming.pptx
KEY
Introduction to Microcontrollers
PPTX
Microcontroller avr
PPTX
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
PDF
UNIT-V (PIC16F877-Microcontrollers).pdf
PPTX
microcontroller-presentation-1-638 (30 files merged).pptx
DOCX
Avr report
PPTX
Introduction to Microcontroller
PDF
Embedded_Systems_firstcourse_UniversitéToulouse.pdf
PPTX
LECT 2.pptx
PPT
8051 Microcontroller slides foe electronics
PPTX
Msp 430 architecture module 1
DOCX
Introduction to pic
PPTX
Overview of Microcontroller and ATMega32 microcontroller
PPTX
3.TechieNest microcontrollers
PPTX
3-8051 Microcontroller-28-01-2024 (1).pptx
PPT
My seminar new 28
PPTX
Presentation
Micro Controllers engineering - computer engineering
Avr microcontroller
MICRO_CONTROLLER PRACTICE1_Programming.pptx
Introduction to Microcontrollers
Microcontroller avr
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
UNIT-V (PIC16F877-Microcontrollers).pdf
microcontroller-presentation-1-638 (30 files merged).pptx
Avr report
Introduction to Microcontroller
Embedded_Systems_firstcourse_UniversitéToulouse.pdf
LECT 2.pptx
8051 Microcontroller slides foe electronics
Msp 430 architecture module 1
Introduction to pic
Overview of Microcontroller and ATMega32 microcontroller
3.TechieNest microcontrollers
3-8051 Microcontroller-28-01-2024 (1).pptx
My seminar new 28
Presentation

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Empathic Computing: Creating Shared Understanding
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Electronic commerce courselecture one. Pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Spectroscopy.pptx food analysis technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MIND Revenue Release Quarter 2 2025 Press Release
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Understanding_Digital_Forensics_Presentation.pptx
Approach and Philosophy of On baking technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Programs and apps: productivity, graphics, security and other tools
Empathic Computing: Creating Shared Understanding
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Building Integrated photovoltaic BIPV_UPV.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Electronic commerce courselecture one. Pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Unlocking AI with Model Context Protocol (MCP)
Spectroscopy.pptx food analysis technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing

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 embeddedin 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 MICROCONTROLLERManufacturer : ATMEL CORPORATION, USA.http://www.atmel.com/
  • 17. ATMEGA 16 SPECIFICATIONS : Advanced RISC Architecture 131 Powerful Instructions – Most Single-clock Cycle Execution32 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
  • 20. RegistersAll 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 PortSo 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, DDRnDetermines 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, PINnReading the input pins of port is done by reading PIN registerTemp = PINA;Read the PORTA input and store in temp variable
  • 25. Port Drive Register, PORTnIf the pin is configured as output (DDRn [x] = 1) PORTn register drives the corresponding value on the output pinsDDRA = 0xFF;PORTA = 0xF0;Output logic high on 4 MSB pins and logic low on 4 LSB pins
  • 26. Port Drive Register, PORTnFor 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 / OFFBuzzer is connected to pin 7 of PORT B.Pin is configured as outputDDRB= 0x80;To turn on the buzzer output highPORTB = 0x80;To turn off the buzzer output lowPORTB = 0x00;
  • 28. Buzzer Functionvoid Buzzer_ON(void){ PORTB = 0x80;}void Buzzer_OFF(void){ PORTB = PORTB & 0x7F;}
  • 29. Bump Switch PORTC (0) Input portDDRC= 0x00; Internal pull upPORTC = 0x01; To read inputsportc_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:PC2PC3PC1PC4PC0
  • 32. This is PORTBPin 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.
  • 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.