SlideShare a Scribd company logo
1 of 29
Download to read 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

More Related Content

What's hot

Data transfer techniques 8085
Data transfer techniques 8085Data transfer techniques 8085
Data transfer techniques 8085ShivamSood22
 
8051 micro controllers Instruction set
8051 micro controllers Instruction set 8051 micro controllers Instruction set
8051 micro controllers Instruction set Nitin Ahire
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduinoyeokm1
 
Interfacing stepper motor
Interfacing stepper motorInterfacing stepper motor
Interfacing stepper motorPRADEEP
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 
8051 microcontroller and it’s interface
8051 microcontroller and it’s interface8051 microcontroller and it’s interface
8051 microcontroller and it’s interfaceAbhishek Choksi
 
Interrupts of 8085
Interrupts of 8085Interrupts of 8085
Interrupts of 8085ShivamSood22
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerJay Makwana
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.pptDr.YNM
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingAnkur Mahajan
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessorkunj desai
 
Tutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsTutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsEdgefxkits & Solutions
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerSudhanshu Janwadkar
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
 

What's hot (20)

8085 MICROPROCESSOR
8085 MICROPROCESSOR 8085 MICROPROCESSOR
8085 MICROPROCESSOR
 
Data transfer techniques 8085
Data transfer techniques 8085Data transfer techniques 8085
Data transfer techniques 8085
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Interrupts
InterruptsInterrupts
Interrupts
 
8051 micro controllers Instruction set
8051 micro controllers Instruction set 8051 micro controllers Instruction set
8051 micro controllers Instruction set
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Interfacing stepper motor
Interfacing stepper motorInterfacing stepper motor
Interfacing stepper motor
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
8051 microcontroller and it’s interface
8051 microcontroller and it’s interface8051 microcontroller and it’s interface
8051 microcontroller and it’s interface
 
Interrupts of 8085
Interrupts of 8085Interrupts of 8085
Interrupts of 8085
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 Microcontroller
 
LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessor
 
Tutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsTutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applications
 
Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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
 

More from محمدعبد الحى (13)

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

Recently uploaded

Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Recently uploaded (20)

Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

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