Introduction to Embedded Systems
Input / Output
Courtesy to Prof. Vahid for the resources used in preparing this lecture note.
Getachew Teshome (Room 120-B)
Addis Ababa University, AAIT
School of Electrical and Computer Engineering
September, 2016
Input Output
Hardware + Software Hardware + Software
Processor
Sensor Actuator
Environment
If vehicle speed is below set point, increase speed.
If tachometer output is below SP, increase DUTY of drive.
Monitoring Input
Eg. Speaker Protection System
How often should this check be made?
• As fast as possible?
• Response Vs Processor Utilization
Capturing Input
• SAMPLING: Reading sensor value at a specified period
• SAMPLING RATE : Period
• SAMPLE : Each data value
Eg
• Temperature sensor in Room conditioning
• Button Press on your phone
Sampling
Sampling period
• should be as large as possible
not to burden the CPU
• should not be to large
not to miss important events
Event Inputs
No system is infinitely fast to detect all events.
Decide on events of interest.
Eg:
₋ Length of speaker volume above threshold
₋ 500ms
₋ Pulse length from a button press
₋ 50ms
Choose Sampling period well below the minimum
pulse duration expected
Event Inputs
Minimum Inter-event Separation Time
Choose Sampling period well below the minimum
Inter-event Separation Time
Event Inputs
Eg
• Buttons on a feature phone
– Minimum duration of a press is 50ms
– Minimum interval b/n two distinct presses – 20ms
– Expected response following a press – 25ms
What should be the sampling period of the button
inputs?
Event Inputs
Eg: What should be the sampling rate?
1.a vehicle sensor in Automatic Traffic
Controller.
2.a burglar sensor that detects whether a person
has passed by the door.
Input Conditioning
Filtering: Ignoring unnecessary events/ values
₋ Input glitch
₋ Noise, EMI
₋ Button bouncing
₋ Button quality
Input Conditioning
Filtering: Ignoring unnecessary events/ values
₋ Hardware Solution
₋ Sensor with cleaner output
₋ Isolating sensor terminals
₋ Capacitor filters
₋ Software Solution
₋ Button debouncing
₋ Consecutive samples
Output Glitch
Example 1
Counter
reset Hold/
Latch
latch
Output Glitch
Example 2
I/O Electrical issues
Low Output capacity
Buffer – boost voltage and/or current
Low capacity Load
Limiting resistor
Indeterminate Pin status
Drive every pin
Pull-up configuration
SHORTAGE OF PINS
• Time-multiplexed output with registers
SHORTAGE OF PINS
• Time-multiplexed output with rapid refresh
SHORTAGE OF PINS
• Encoded Input
i1
i2
i3
.
. Priority Encoder
.
.
.
.
.
i9
i10
SHORTAGE OF PINS
• Time-multiplexed Input (Input scanning)