Title: Computer Engineering HandsOn Interfacing Activities Summer Institute 2001
1Computer EngineeringHands-On Interfacing
Activities Summer Institute 2001
- Graham Smyth
- smythel_at_mnsi.net
2Computer Engineering Units
- Hardware
- Networking
- Chips
- Programming
- Interfaces
3Interfacing System
Computer Interface Peripheral
- LEDs
- Motors
- Lights
- Robots
- Wires
- ICs
- Resistors
- Capacitors
- Transistors
4Grade 10 Interfacing Activities
- LED
- Three LEDs
- LED simulators
- ASCII
- Binary counting
- Light patterns
- Intersections
- AC ?
5The Breadboard
Connected (horizontally)
Divider
Connected (vertically)
Connected (horizontally)
6Parallelport(printer port)
13 12 11 10 9 8 7 6
5 4 3 2 1
Output Pins
Grounds
25 24 23 22 21 20 19 18 17
16 15 14
View from back of Computer
7One Bit Interfacing System
8Resistor
2 2 X 101
Red Red
Brown Gold
9Resistor Chart
10LED
long lead
11Interface Wire
Stripped Wire Male Pin
12One Bit Interfacing System
13D Sub connector
Pin 2
D sub Connector
Pin 18
Inserted into pin 2
D sub Connector
Inserted into pin 18
14One Bit Interface (physical)
To pin 2 of D sub Connector
220 ohm
- side of LED
side of LED
To pin 18 of D sub Connector
15One Bit Assignment
- Purpose
- Turn the LED on for 4 second
- Turn the LED off for 3 seconds
- Turn the LED on for 2 seconds
- Turn the LED off
16parallelput (1) Turns LED ondelay
(4000) Waits 4
secondsparallelput (0) Turns LED
offdelay (3000) Waits 3
secondsparallelput (1) Turns LED
ondelay (2000) Waits 2
secondsparallelput (0) Turns
LED off
One Bit Answer
17Graphics Screen
(640,480)
(0,0)
18One Bit GUI AssignmentAdd to the previous
program a graphical representation of an LED that
will turn on and off as the real world LED turns
on and off.
19setscreen(graphicsvga) To graphics
modedrawoval( 320, 240, 20, 20, 1) To draw an
oval in blueparallelput (1)
Turns LED ondrawfill( 320,240 , 4, 1)
To fill the oval with red delay (4000)
Waits 4 seconds
parallelput (0)
Turns LED offdrawfill(320, 240, 0,
1) To fill the oval with black
delay (3000) Waits
3 secondsparallelput (1)
Turns LED ondrawfill( 320,240 , 4, 1)
To fill the oval with red delay (2000)
Waits 2
secondsparallelput (0)
Turns LED offdrawfill(320, 240, 0, 1)
To fill the oval with black
One Bit GUI Answer
20One Bit GUI Enrichment Assignment
- Display 3 boxes on the screen
- Label the boxes ON, OFF, and EXIT
- When the first box is clicked, the virtual and
peripheral LEDs should turn on - When the second box is clicked, the virtual and
peripheral LEDs should turn off - When the third box is clicked, the program should
exit.
211 Byte Interface
220?
9 8 7 6 5 4 3 2
18
221 Byte Interface Assignment
- Count from 0 to 255, displaying each number on
the screen and on the 1 byte display. - Draw 8 circles representing the 8 LEDs. Count
again from 0 to 255, simulating the lighting of
each LED on the screen by filling the appropriate
circle with red. - Ask the user to enter any single character from
the keyboard, then display the ASCII equivalent
(decimal binary) of this character on the
screen. Display the ASCII equivalent (binary) on
the 1 byte peripheral. - Ask the user to enter their name. Display their
name in lights, one character at a time. - Display a Knight Rider pattern in lights.
231 Byte Interface Enrichment Assignment
- Display 3 boxes on the screen
- When the first box is clicked, the virtual and
real LEDs should count from 0 to 255 - When the second box is clicked, the virtual and
real LEDs should display the Binary/ASCII
equivalent of any character entered by the user - When the third box is clicked, the program should
exit
24Buffer 74LS245
Bus A to B
DIR5V
E GND
25Grade 11 Interfacing Activities
- One bit
- One byte
- DC motor
- Bi-directional DC motor
- LED traffic light
- LED intersection
- Demultiplexer
- GUIs
- Mouse control
- AC ????
26Transistor TIP31Physical
Schematic
Emitter Base Collector (Right Left
Middle)
Base Collector Emitter
27Motor Control
28Motor Control (physical)
1 K
TIP 31
5V
Neg
To pin 2 of D sub Connector
Neg
To pin 18 of D sub Connector
Motor
29Demultiplexer(74LS154)
30Addresses
smythel_at_mnsi.net www.aaroncake.net/electronics/qb
ltp www.classictech.on.ca www.holtsoft.com www.
lvr.com/parport.htm