SlideShare uma empresa Scribd logo
1 de 29
Baixar para ler offline
Digital
Input /Output
Driver
Mina Yousry
Copyright © 2012 Embedded Systems
Committee
Agenda:
•

Topics:






•

ATMEGA 32 and DIO
pull up and down resistors
types of switches
switch bouncing
Led ,seven segment and Led Matrix

Practical work :






switching led on and off through sw with delay
switching led on and off through switch
exp of bouncing and solve it through Sw(first time) and Hw(second time)
make any digit on Led matrix
make counter using seven segment
Copyright © 2012 Embedded Systems
Committee
 ATMEGA 32 and DIO:
ATmega 32 has 32 programmable I/O lines divided into 4 PORTS(groups):
1-PORTA(PA7……..PAO)
2-PORTB(PB7….…..PBO)
3-PORTC(PC7….…..PCO)
4-PORTD(PD7……..PDO)

Each PORT is controlled by 3 registers:
1-DDRx (Data Direction Register)
2-PORTx (Output Register)
3-PINx (Input Register

Note: Most pins in Mc make more than one function(multiplexed
functions)
Copyright © 2012 Embedded Systems
Committee
 ATMEGA 32 and DIO (cont.):
ATmega 32 pin out

Copyright © 2012 Embedded Systems
Committee
 ATMEGA 32 and DIO (cont.):
Register controlling I/O port:

Copyright © 2012 Embedded Systems
Committee
 How to set value in register:
Example:
DDRA=5;

//(decimal)mean I activate pin 0 and pin 2 as output
and the rest as input pins

DDRB=0x14;

//(hexadecimal)mean I activate pin 2 and pin 4 as
output and the rest as input pins

DDRC=0b00000011;

//(binary)mean I activate pin 0 and pin1 as output
and the rest as input pins

Copyright © 2012 Embedded Systems
Committee
 How to set a specific pin with conserving
other pins:
To set specified pin with 1:
Make OR operation on the register with The pin no
Example: We want to set pin no 5 with 1
PORTA=PORTA|(0b00100000);

//(decimal)32

To set specified pin with 0:
Make AND operation on the register with (NOT) The pin no
Example: We want to set pin no 3 with 0
PORTB=PORTB&( ~(0b00001000) );

//(decimal)8

Copyright © 2012 Embedded Systems
Committee
 How to set a specific pin with conserving
other pins:
To toggle specified pin with 0:
Make XOR operation on the register with The pin no
Example: We want to set pin no 2 with 0
PORTB=PORTB^(0b00000100) );

//(decimal)4

Copyright © 2012 Embedded Systems
Committee
 ATMEGA 32 and DIO (cont.):
Driving pin:

Copyright © 2012 Embedded Systems
Committee
 Pull up and pull down resistors:
Consider this schematics:
• The input state of most logic gates is called a high impedance.
• the value of the input is considered to be floating.
• Most gates will float towards a high state. This is a very weak condition,
and any electrical noise could cause the input to go low.
• This convert pin as antenna that can receive electrical noise

Copyright © 2012 Embedded Systems
Committee
 Pull up and pull down resistors (cont.):
Solution:

Copyright © 2012 Embedded Systems
Committee
 Switches:
Types of electronics switches
Toggle switch: The toggle switch is usually a two position switch. The internal
construction includes a spring such that it is held firmly in the position to which it
has been switched.
Push button switch: Push button switches are used in many electronic circuits.
These electronic switches are often used when a push action is required to give a
momentary connection.
Rotary switch: As the name implies, rotary switches are operated by turning a knob.
Selecting the correct position enables the relevant connections to be made.

Copyright © 2012 Embedded Systems
Committee
 Switches (cont.):
ON-OFF
Single Pole, Single Throw = SPST

(ON)-OFF
Push-to-make = SPST Momentary

ON-(OFF)
Push-to-break = SPST Momentary

Copyright © 2012 Embedded Systems
Committee
 Switches (cont.):
ON-ON
Single Pole, Double Throw = SPDT

ON-OFF-ON
SPDT Centre Off

Dual ON-OFF
Double Pole, Single Throw = DPST

Copyright © 2012 Embedded Systems
Committee
 Switches (cont.):
Dual ON-ON
Double Pole, Double Throw = DPDT
ON-OFF-ON
DPDT Centre Off

DIP Switch (DIP = Dual In-line Parallel)

Multi-way Switch

Copyright © 2012 Embedded Systems
Committee
 Switches (cont.):
Switch parameters and specifications
1-volltage rating: This is the maximum voltage that the switch can
withstand
.
2-Current carrying rating: The rating of the maximum steady current that a
switch can carry through a closed contact.

3-Contact resistance

4-Number of operations:

Copyright © 2012 Embedded Systems
Committee
 Dealing with Switch Bouncing:
The Problem:
Switch closed:0v
Switch opened:5v
>Due to the mechanical nature of any switch that may contains spring
return action of some kind.

>there wont be a clean transition from a state
to another.

>there will be a series of high and low states
spikes as shown.

Copyright © 2012 Embedded Systems
Committee
 Dealing with Switch Bouncing (cont.):
The Solution:
1-Hardware Based:
>Add a capacitor that makes the voltage smooth
and clean(without spikes).

>the value of R and C determine to react and give
adequate output , As T=RC and the capacitor is full
charged at 5T:
>you can choose R1 = 10 K and C1 = 100 nf
>add a schmitt trigger so that it can output
5v (threshold value)when capacitor Is full
charged.

Copyright © 2012 Embedded Systems
Committee
 Dealing with Switch Bouncing (cont.):
2-Software Based:

>T1 and T2 are fake logic 0 but T3 is the valid one
> Difference between those is their length.

>Make a counter count up as long as the signal is Low, and reset this counter when
the signal is High.
>If the counter reach a fixed value(bigger than T1 or T2) this means that
the pulse is a valid pulse (T3).
Copyright © 2012 Embedded Systems
Committee
 LED:

>we want to calculate value of Resistance that put in serial with Led:
>supply voltage Vcc=5v

>According to datasheet Vd=2v, Id=15mA

>so the value of resistance is 200 ohm
Copyright © 2012 Embedded Systems
Committee
 Seven Segment Display (cont.):

>The required current per small segment is 2mA in very small display

>The current per segment is 60 mA and increase in the case of of larger Display.
>For safe mode we can use a driver such as UDN2981A and UDN2585A IC’s.

Copyright © 2012 Embedded Systems
Committee
 Seven Segment Display:

>UDN2585A can source up to 120 mA while UDN2981A can source up to 500mA.

>So that we can illuminate large displays without burning the Microcontroller.
Copyright © 2012 Embedded Systems
Committee
 LED Matrix:

>We have a Problem here that we have to connect column pins to micro
and the micro pins must be Logic 0.
> so that micro has to sink so much current so that we need a solution.
Copyright © 2012 Embedded Systems
Committee
 LED Matrix (cont.)
The solution
Put ULN2003A IC that output 0 when the input is 1,so we can output Logic 1
from micro that make it protected.

Copyright © 2012 Embedded Systems
Committee
 LED Matrix (cont.)
How we can write alphabet A on Led Matrix???

Copyright © 2012 Embedded Systems
Committee
 LED Matrix (cont.)

Steps

Copyright © 2012 Embedded Systems
Committee
Copyright © 2012 Embedded Systems
Committee
Programming Embedded System I(book)
Esc Presentation
Links:
http://www.kpsec.freeuk.com/components/switch.htm
http://www.electronics-radio.com/articles/electronic_components/switchesrelays/electronics-switches.php
http://www.ikalogic.com/de-bouncing-circuits/
http://www.micahcarrick.com/avr-tutorial-switch-debounce.html

http://embedded-lab.com/blog/?p=2478

Copyright © 2012 Embedded Systems
Committee
info@escommittee.net
education@escommittee.com

Copyright © 2012 Embedded Systems
Committee

Mais conteúdo relacionado

Mais procurados

Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to MicrocontrollerNikhil Sharma
 
Difference Between CISC RISC, Harward & Von-neuman
Difference Between CISC RISC, Harward & Von-neumanDifference Between CISC RISC, Harward & Von-neuman
Difference Between CISC RISC, Harward & Von-neumanKailas Kharse
 
"BCD TO 7 SEGMENT DISPLAY DECODER"
"BCD TO 7 SEGMENT DISPLAY DECODER""BCD TO 7 SEGMENT DISPLAY DECODER"
"BCD TO 7 SEGMENT DISPLAY DECODER"FAIZAN SHAFI
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086Dr. AISHWARYA N
 
Arm modes
Arm modesArm modes
Arm modesabhi165
 
Micro Programmed Control Unit
Micro Programmed Control UnitMicro Programmed Control Unit
Micro Programmed Control UnitKamal Acharya
 
Interfacing of io device to 8085
Interfacing of io device to 8085Interfacing of io device to 8085
Interfacing of io device to 8085Nitin Ahire
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)Zubair Khalid
 
Datapath Design of Computer Architecture
Datapath Design of Computer ArchitectureDatapath Design of Computer Architecture
Datapath Design of Computer ArchitectureAbu Zaman
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086aviban
 
Chapter 1 microprocessor introduction
Chapter 1 microprocessor introductionChapter 1 microprocessor introduction
Chapter 1 microprocessor introductionShubham Singh
 
Introduction to arm processor
Introduction to arm processorIntroduction to arm processor
Introduction to arm processorRAMPRAKASHT1
 
Embedded system design process
Embedded system design processEmbedded system design process
Embedded system design processRayees CK
 

Mais procurados (20)

ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
 
Registers
RegistersRegisters
Registers
 
Introduction to Microcontroller
Introduction to MicrocontrollerIntroduction to Microcontroller
Introduction to Microcontroller
 
Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32 Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32
 
Control unit
Control unitControl unit
Control unit
 
Embedded c
Embedded cEmbedded c
Embedded c
 
Difference Between CISC RISC, Harward & Von-neuman
Difference Between CISC RISC, Harward & Von-neumanDifference Between CISC RISC, Harward & Von-neuman
Difference Between CISC RISC, Harward & Von-neuman
 
"BCD TO 7 SEGMENT DISPLAY DECODER"
"BCD TO 7 SEGMENT DISPLAY DECODER""BCD TO 7 SEGMENT DISPLAY DECODER"
"BCD TO 7 SEGMENT DISPLAY DECODER"
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
Arm modes
Arm modesArm modes
Arm modes
 
8051 block diagram
8051 block diagram8051 block diagram
8051 block diagram
 
Micro Programmed Control Unit
Micro Programmed Control UnitMicro Programmed Control Unit
Micro Programmed Control Unit
 
Interfacing of io device to 8085
Interfacing of io device to 8085Interfacing of io device to 8085
Interfacing of io device to 8085
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)
 
Datapath Design of Computer Architecture
Datapath Design of Computer ArchitectureDatapath Design of Computer Architecture
Datapath Design of Computer Architecture
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Chapter 1 microprocessor introduction
Chapter 1 microprocessor introductionChapter 1 microprocessor introduction
Chapter 1 microprocessor introduction
 
Introduction to arm processor
Introduction to arm processorIntroduction to arm processor
Introduction to arm processor
 
Embedded system design process
Embedded system design processEmbedded system design process
Embedded system design process
 
Embedded C - Optimization techniques
Embedded C - Optimization techniquesEmbedded C - Optimization techniques
Embedded C - Optimization techniques
 

Destaque

Hindavi Technologies Profile
Hindavi Technologies ProfileHindavi Technologies Profile
Hindavi Technologies Profileonebhushan
 
ประวัติส่วนตัว
ประวัติส่วนตัวประวัติส่วนตัว
ประวัติส่วนตัวLynnie1177
 
อังกฤษ
อังกฤษอังกฤษ
อังกฤษLynnie1177
 
Sp soft profile (15-may-2012)
Sp soft profile (15-may-2012)Sp soft profile (15-may-2012)
Sp soft profile (15-may-2012)SP SOFTWARE
 
แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์Lynnie1177
 
Regulamento concursoleituraconcelho ourem_aeco
Regulamento concursoleituraconcelho ourem_aecoRegulamento concursoleituraconcelho ourem_aeco
Regulamento concursoleituraconcelho ourem_aecobibliotecaoureana
 
แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์Lynnie1177
 
Unlocking funding opportunities final
Unlocking funding opportunities finalUnlocking funding opportunities final
Unlocking funding opportunities finalsaqib_bsettlement
 
Obeijodapalavrinha2miacouto
Obeijodapalavrinha2miacouto Obeijodapalavrinha2miacouto
Obeijodapalavrinha2miacouto bibliotecaoureana
 

Destaque (20)

Lin bus
Lin busLin bus
Lin bus
 
Hindavi Technologies Profile
Hindavi Technologies ProfileHindavi Technologies Profile
Hindavi Technologies Profile
 
ประวัติส่วนตัว
ประวัติส่วนตัวประวัติส่วนตัว
ประวัติส่วนตัว
 
อังกฤษ
อังกฤษอังกฤษ
อังกฤษ
 
Bigalytics
BigalyticsBigalytics
Bigalytics
 
Gato renato
Gato renatoGato renato
Gato renato
 
Day1
Day1Day1
Day1
 
Montras com livros 2015
Montras com livros 2015Montras com livros 2015
Montras com livros 2015
 
Sp soft profile (15-may-2012)
Sp soft profile (15-may-2012)Sp soft profile (15-may-2012)
Sp soft profile (15-may-2012)
 
แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์
 
Office 2010 migration
Office 2010 migrationOffice 2010 migration
Office 2010 migration
 
Regulamento concursoleituraconcelho ourem_aeco
Regulamento concursoleituraconcelho ourem_aecoRegulamento concursoleituraconcelho ourem_aeco
Regulamento concursoleituraconcelho ourem_aeco
 
คณิต
คณิตคณิต
คณิต
 
แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์แบบโครงร่างโครงงานคอมพิวเตอร์
แบบโครงร่างโครงงานคอมพิวเตอร์
 
Unlocking funding opportunities final
Unlocking funding opportunities finalUnlocking funding opportunities final
Unlocking funding opportunities final
 
Mo ta du an
Mo ta du anMo ta du an
Mo ta du an
 
Matlab workshop
Matlab workshopMatlab workshop
Matlab workshop
 
Project Report
Project ReportProject Report
Project Report
 
Kbox 101 1000 slide
Kbox 101 1000 slideKbox 101 1000 slide
Kbox 101 1000 slide
 
Obeijodapalavrinha2miacouto
Obeijodapalavrinha2miacouto Obeijodapalavrinha2miacouto
Obeijodapalavrinha2miacouto
 

Semelhante a Dio

UNIT 4 & 5 - I nterfacing_Lecture7.pptx
UNIT 4 & 5 - I         nterfacing_Lecture7.pptxUNIT 4 & 5 - I         nterfacing_Lecture7.pptx
UNIT 4 & 5 - I nterfacing_Lecture7.pptxnaveen088888
 
Advanced motion controls 25a20dd
Advanced motion controls 25a20ddAdvanced motion controls 25a20dd
Advanced motion controls 25a20ddElectromate
 
Cockpit White Box
Cockpit White BoxCockpit White Box
Cockpit White Boxncct
 
Advanced motion controls 50a20dd
Advanced motion controls 50a20ddAdvanced motion controls 50a20dd
Advanced motion controls 50a20ddElectromate
 
Advanced motion controls 50a8dd
Advanced motion controls 50a8ddAdvanced motion controls 50a8dd
Advanced motion controls 50a8ddElectromate
 
Advanced motion controls 30a8dd
Advanced motion controls 30a8ddAdvanced motion controls 30a8dd
Advanced motion controls 30a8ddElectromate
 
Advanced motion controls azbe12a8
Advanced motion controls azbe12a8Advanced motion controls azbe12a8
Advanced motion controls azbe12a8Electromate
 
IRJET- IoT based Industrial Automation
IRJET-  	  IoT based Industrial AutomationIRJET-  	  IoT based Industrial Automation
IRJET- IoT based Industrial AutomationIRJET Journal
 
Bluetooth based home appliances control
Bluetooth based home appliances controlBluetooth based home appliances control
Bluetooth based home appliances controlPROJECTRONICS
 
Advanced motion controls bdc30a8
Advanced motion controls bdc30a8Advanced motion controls bdc30a8
Advanced motion controls bdc30a8Electromate
 
Advanced motion controls az12a8ddc
Advanced motion controls az12a8ddcAdvanced motion controls az12a8ddc
Advanced motion controls az12a8ddcElectromate
 
Advanced motion controls azbe6a8
Advanced motion controls azbe6a8Advanced motion controls azbe6a8
Advanced motion controls azbe6a8Electromate
 
Advanced motion controls az6a8ddc
Advanced motion controls az6a8ddcAdvanced motion controls az6a8ddc
Advanced motion controls az6a8ddcElectromate
 
Elc Inverter Introduction
Elc Inverter IntroductionElc Inverter Introduction
Elc Inverter Introductionscottburge
 
Advanced motion controls bdc40a20
Advanced motion controls bdc40a20Advanced motion controls bdc40a20
Advanced motion controls bdc40a20Electromate
 
QuickSilver Controls QCI-DS018 QCI-D2-IG8
QuickSilver Controls QCI-DS018 QCI-D2-IG8QuickSilver Controls QCI-DS018 QCI-D2-IG8
QuickSilver Controls QCI-DS018 QCI-D2-IG8Electromate
 

Semelhante a Dio (20)

UNIT 4 & 5 - I nterfacing_Lecture7.pptx
UNIT 4 & 5 - I         nterfacing_Lecture7.pptxUNIT 4 & 5 - I         nterfacing_Lecture7.pptx
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
 
Advanced motion controls 25a20dd
Advanced motion controls 25a20ddAdvanced motion controls 25a20dd
Advanced motion controls 25a20dd
 
Cockpit White Box
Cockpit White BoxCockpit White Box
Cockpit White Box
 
Badal sharma
Badal sharmaBadal sharma
Badal sharma
 
Advanced motion controls 50a20dd
Advanced motion controls 50a20ddAdvanced motion controls 50a20dd
Advanced motion controls 50a20dd
 
Advanced motion controls 50a8dd
Advanced motion controls 50a8ddAdvanced motion controls 50a8dd
Advanced motion controls 50a8dd
 
Advanced motion controls 30a8dd
Advanced motion controls 30a8ddAdvanced motion controls 30a8dd
Advanced motion controls 30a8dd
 
embedded system
embedded system  embedded system
embedded system
 
Advanced motion controls azbe12a8
Advanced motion controls azbe12a8Advanced motion controls azbe12a8
Advanced motion controls azbe12a8
 
IRJET- IoT based Industrial Automation
IRJET-  	  IoT based Industrial AutomationIRJET-  	  IoT based Industrial Automation
IRJET- IoT based Industrial Automation
 
Ge8808 led datasheet
Ge8808 led datasheetGe8808 led datasheet
Ge8808 led datasheet
 
Bluetooth based home appliances control
Bluetooth based home appliances controlBluetooth based home appliances control
Bluetooth based home appliances control
 
Advanced motion controls bdc30a8
Advanced motion controls bdc30a8Advanced motion controls bdc30a8
Advanced motion controls bdc30a8
 
Advanced motion controls az12a8ddc
Advanced motion controls az12a8ddcAdvanced motion controls az12a8ddc
Advanced motion controls az12a8ddc
 
Advanced motion controls azbe6a8
Advanced motion controls azbe6a8Advanced motion controls azbe6a8
Advanced motion controls azbe6a8
 
Advanced motion controls az6a8ddc
Advanced motion controls az6a8ddcAdvanced motion controls az6a8ddc
Advanced motion controls az6a8ddc
 
Elc Inverter Introduction
Elc Inverter IntroductionElc Inverter Introduction
Elc Inverter Introduction
 
Embedded System[586]
Embedded System[586]Embedded System[586]
Embedded System[586]
 
Advanced motion controls bdc40a20
Advanced motion controls bdc40a20Advanced motion controls bdc40a20
Advanced motion controls bdc40a20
 
QuickSilver Controls QCI-DS018 QCI-D2-IG8
QuickSilver Controls QCI-DS018 QCI-D2-IG8QuickSilver Controls QCI-DS018 QCI-D2-IG8
QuickSilver Controls QCI-DS018 QCI-D2-IG8
 

Mais de محمدعبد الحى (12)

Iso26262 component reuse_webinar
Iso26262 component reuse_webinarIso26262 component reuse_webinar
Iso26262 component reuse_webinar
 
Can bus
Can busCan bus
Can bus
 
Embedded Systems in Automotive
Embedded Systems in Automotive Embedded Systems in Automotive
Embedded Systems in Automotive
 
MATLAB Programming
MATLAB Programming MATLAB Programming
MATLAB Programming
 
CPU Architecture
CPU ArchitectureCPU Architecture
CPU Architecture
 
8 bit microcontroller
8 bit microcontroller8 bit microcontroller
8 bit microcontroller
 
Timers
TimersTimers
Timers
 
Interrupts
InterruptsInterrupts
Interrupts
 
Uart
UartUart
Uart
 
Sw testing
Sw testingSw testing
Sw testing
 
Rtos
RtosRtos
Rtos
 
Micro controller
Micro controllerMicro controller
Micro controller
 

Último

Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 

Último (20)

Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 

Dio

  • 1. Digital Input /Output Driver Mina Yousry Copyright © 2012 Embedded Systems Committee
  • 2. Agenda: • Topics:      • ATMEGA 32 and DIO pull up and down resistors types of switches switch bouncing Led ,seven segment and Led Matrix Practical work :      switching led on and off through sw with delay switching led on and off through switch exp of bouncing and solve it through Sw(first time) and Hw(second time) make any digit on Led matrix make counter using seven segment Copyright © 2012 Embedded Systems Committee
  • 3.  ATMEGA 32 and DIO: ATmega 32 has 32 programmable I/O lines divided into 4 PORTS(groups): 1-PORTA(PA7……..PAO) 2-PORTB(PB7….…..PBO) 3-PORTC(PC7….…..PCO) 4-PORTD(PD7……..PDO) Each PORT is controlled by 3 registers: 1-DDRx (Data Direction Register) 2-PORTx (Output Register) 3-PINx (Input Register Note: Most pins in Mc make more than one function(multiplexed functions) Copyright © 2012 Embedded Systems Committee
  • 4.  ATMEGA 32 and DIO (cont.): ATmega 32 pin out Copyright © 2012 Embedded Systems Committee
  • 5.  ATMEGA 32 and DIO (cont.): Register controlling I/O port: Copyright © 2012 Embedded Systems Committee
  • 6.  How to set value in register: Example: DDRA=5; //(decimal)mean I activate pin 0 and pin 2 as output and the rest as input pins DDRB=0x14; //(hexadecimal)mean I activate pin 2 and pin 4 as output and the rest as input pins DDRC=0b00000011; //(binary)mean I activate pin 0 and pin1 as output and the rest as input pins Copyright © 2012 Embedded Systems Committee
  • 7.  How to set a specific pin with conserving other pins: To set specified pin with 1: Make OR operation on the register with The pin no Example: We want to set pin no 5 with 1 PORTA=PORTA|(0b00100000); //(decimal)32 To set specified pin with 0: Make AND operation on the register with (NOT) The pin no Example: We want to set pin no 3 with 0 PORTB=PORTB&( ~(0b00001000) ); //(decimal)8 Copyright © 2012 Embedded Systems Committee
  • 8.  How to set a specific pin with conserving other pins: To toggle specified pin with 0: Make XOR operation on the register with The pin no Example: We want to set pin no 2 with 0 PORTB=PORTB^(0b00000100) ); //(decimal)4 Copyright © 2012 Embedded Systems Committee
  • 9.  ATMEGA 32 and DIO (cont.): Driving pin: Copyright © 2012 Embedded Systems Committee
  • 10.  Pull up and pull down resistors: Consider this schematics: • The input state of most logic gates is called a high impedance. • the value of the input is considered to be floating. • Most gates will float towards a high state. This is a very weak condition, and any electrical noise could cause the input to go low. • This convert pin as antenna that can receive electrical noise Copyright © 2012 Embedded Systems Committee
  • 11.  Pull up and pull down resistors (cont.): Solution: Copyright © 2012 Embedded Systems Committee
  • 12.  Switches: Types of electronics switches Toggle switch: The toggle switch is usually a two position switch. The internal construction includes a spring such that it is held firmly in the position to which it has been switched. Push button switch: Push button switches are used in many electronic circuits. These electronic switches are often used when a push action is required to give a momentary connection. Rotary switch: As the name implies, rotary switches are operated by turning a knob. Selecting the correct position enables the relevant connections to be made. Copyright © 2012 Embedded Systems Committee
  • 13.  Switches (cont.): ON-OFF Single Pole, Single Throw = SPST (ON)-OFF Push-to-make = SPST Momentary ON-(OFF) Push-to-break = SPST Momentary Copyright © 2012 Embedded Systems Committee
  • 14.  Switches (cont.): ON-ON Single Pole, Double Throw = SPDT ON-OFF-ON SPDT Centre Off Dual ON-OFF Double Pole, Single Throw = DPST Copyright © 2012 Embedded Systems Committee
  • 15.  Switches (cont.): Dual ON-ON Double Pole, Double Throw = DPDT ON-OFF-ON DPDT Centre Off DIP Switch (DIP = Dual In-line Parallel) Multi-way Switch Copyright © 2012 Embedded Systems Committee
  • 16.  Switches (cont.): Switch parameters and specifications 1-volltage rating: This is the maximum voltage that the switch can withstand . 2-Current carrying rating: The rating of the maximum steady current that a switch can carry through a closed contact. 3-Contact resistance 4-Number of operations: Copyright © 2012 Embedded Systems Committee
  • 17.  Dealing with Switch Bouncing: The Problem: Switch closed:0v Switch opened:5v >Due to the mechanical nature of any switch that may contains spring return action of some kind. >there wont be a clean transition from a state to another. >there will be a series of high and low states spikes as shown. Copyright © 2012 Embedded Systems Committee
  • 18.  Dealing with Switch Bouncing (cont.): The Solution: 1-Hardware Based: >Add a capacitor that makes the voltage smooth and clean(without spikes). >the value of R and C determine to react and give adequate output , As T=RC and the capacitor is full charged at 5T: >you can choose R1 = 10 K and C1 = 100 nf >add a schmitt trigger so that it can output 5v (threshold value)when capacitor Is full charged. Copyright © 2012 Embedded Systems Committee
  • 19.  Dealing with Switch Bouncing (cont.): 2-Software Based: >T1 and T2 are fake logic 0 but T3 is the valid one > Difference between those is their length. >Make a counter count up as long as the signal is Low, and reset this counter when the signal is High. >If the counter reach a fixed value(bigger than T1 or T2) this means that the pulse is a valid pulse (T3). Copyright © 2012 Embedded Systems Committee
  • 20.  LED: >we want to calculate value of Resistance that put in serial with Led: >supply voltage Vcc=5v >According to datasheet Vd=2v, Id=15mA >so the value of resistance is 200 ohm Copyright © 2012 Embedded Systems Committee
  • 21.  Seven Segment Display (cont.): >The required current per small segment is 2mA in very small display >The current per segment is 60 mA and increase in the case of of larger Display. >For safe mode we can use a driver such as UDN2981A and UDN2585A IC’s. Copyright © 2012 Embedded Systems Committee
  • 22.  Seven Segment Display: >UDN2585A can source up to 120 mA while UDN2981A can source up to 500mA. >So that we can illuminate large displays without burning the Microcontroller. Copyright © 2012 Embedded Systems Committee
  • 23.  LED Matrix: >We have a Problem here that we have to connect column pins to micro and the micro pins must be Logic 0. > so that micro has to sink so much current so that we need a solution. Copyright © 2012 Embedded Systems Committee
  • 24.  LED Matrix (cont.) The solution Put ULN2003A IC that output 0 when the input is 1,so we can output Logic 1 from micro that make it protected. Copyright © 2012 Embedded Systems Committee
  • 25.  LED Matrix (cont.) How we can write alphabet A on Led Matrix??? Copyright © 2012 Embedded Systems Committee
  • 26.  LED Matrix (cont.) Steps Copyright © 2012 Embedded Systems Committee
  • 27. Copyright © 2012 Embedded Systems Committee
  • 28. Programming Embedded System I(book) Esc Presentation Links: http://www.kpsec.freeuk.com/components/switch.htm http://www.electronics-radio.com/articles/electronic_components/switchesrelays/electronics-switches.php http://www.ikalogic.com/de-bouncing-circuits/ http://www.micahcarrick.com/avr-tutorial-switch-debounce.html http://embedded-lab.com/blog/?p=2478 Copyright © 2012 Embedded Systems Committee