SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances (20)

Electronics Microcontrollers for IoT applications
Electronics Microcontrollers for IoT applicationsElectronics Microcontrollers for IoT applications
Electronics Microcontrollers for IoT applications
 
Encoder
EncoderEncoder
Encoder
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
Arduino Projects
Arduino ProjectsArduino Projects
Arduino Projects
 
Encoder & Decoder
Encoder & DecoderEncoder & Decoder
Encoder & Decoder
 
AVR ATmega32
AVR ATmega32AVR ATmega32
AVR ATmega32
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontroller
 
Getting started with arduino uno
Getting started with arduino unoGetting started with arduino uno
Getting started with arduino uno
 
8 bit microcontroller
8 bit microcontroller8 bit microcontroller
8 bit microcontroller
 
Microcontroller presentation
Microcontroller presentationMicrocontroller presentation
Microcontroller presentation
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 complete
 
Embedded c
Embedded cEmbedded c
Embedded c
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
08 decoder
08 decoder08 decoder
08 decoder
 
Microprocessors and microcontrollers
Microprocessors and microcontrollersMicroprocessors and microcontrollers
Microprocessors and microcontrollers
 
Embedded System Networking
Embedded System NetworkingEmbedded System Networking
Embedded System Networking
 
Avr microcontroller
Avr microcontrollerAvr microcontroller
Avr microcontroller
 
Bus
BusBus
Bus
 
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
UNIT III PROGRAMMABLE PERIPHERAL INTERFACE
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

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

Iso26262 component reuse_webinar
Iso26262 component reuse_webinarIso26262 component reuse_webinar
Iso26262 component reuse_webinar
 
Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32 Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32
 
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
 
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
 

Dernier

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 

Dernier (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

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