EECS 373 Standard Project Devices
Displays
The standard
character display is the Optrex, DMC16433 4*16, Character Display . The
display can display 4 rows of 16 characters. This display is interfaced
via a simple 8 bit parallel data path. Consider the following
approach to get this type of device working:
- Map FPGA IO to the connector of the display. The display has a
single row header so you can plug it into the proto-board easily. You
may need to map connections with wires to the desired FPGA IO
pins. You will also have to connect power and ground to the display to
the proto-board. See the
appropriate specs for the connector pin information.
- The
key to using a device like this is understanding the functionality of
the integrated micro controller. This device uses a controller
originally developed by Hitachi, the HD44780. Display control and
access is accomplished by writing the HD44780 control and data
registers. Read the spec and related documents to get a idea of how
this works.
- To write the control and data registers successfully, you will
have develop a bus controller that accommodates the registers setup and
hold times. Read the HD44780 write timing diagrams and specifications
as you learned in lab 8 for the ADC0808. Verify your timing with the
logic analyzer and write commands in SingleStep.
- The HD44780 also has read registers that provide status and
allow you to read the character display memory. Micro controllers
generally have a "command latency" time associated with certain
operations. So that you do not overwrite a control or data register
during this time a "busy" status bit is provided. The bit can be read
to determine when the controller is ready for the next write command or
data write. It is possible to avoid this process by reading the spec
for the worst case latencies and simply using timers to make sure you
wait long enough. This is an acceptable implementation. However, if you
implement a read interface and use the busy status, you will get extra
difficulty credit.
- The HD44780 controller is capable of supporting many types of
character displays. It has to be initialized for this display. See the
specification for the appropriate sequence and register contents. To
debug and test, consider writing the sequence via SingleStep commands.
If you are successful, a cursor should appear on the display.
- Next write, the character display memory via SingleStep and see
if you can display characters. Notice that the character codes are not
ASCII.
- Finally test your display with software.
The spec for the
display controller contains timing and initialization.
The manufacturers
mechanical spec contains connector pin outs.
This link is
provided by a supplier of Optrex components. These can be quite helpful
because they generally do all the messy business of extracting
essential information buried in the manufacturers specs. This link
refers to the Optrex model DMC 20481 4*20 character display. However,
much of it is applicable because it uses the HD44780 controller.
Graphics
Display
The
standard graphics display is the Optrex,
DMF 5005, 240*64 pixel display using the integrated T6963 controller.
The display is capable of displaying in
both character and graphics mode. Like the character display, you must
interface to an integrated controller via a 8 bit parallel bus. Unlike
the character display, the controller operation
requires
the
implementation of a bi-directional data bus. This device is
considerably more difficulty to work with then the character display
because of the complexity of the controller and display modes. Develop
steps similar to those suggested for the character display to partition
the debug and hardware/software development.
The graphics module does not have a convenient
single row header that easily plugs into a the protoboard. Instead you
must use a ribbon cable that connects the 2 row header of the display
to a 2 row socket that will connect into the protoboard. The 2 row
header of the display is then mapped to the 2 row header socket. Use
hookup wire to jumper over to interface board connections. Add power
and ground as needed from the IO expansion kit power supply. You may
have to use a "ohm meter" to check the mapping of the ribbon connector
by checking the continuity between header pins.
The graphics module power requirements include a 5
and -12 (VEE) volt supply. You can use the supplies on the project
expansion board. The 5 volt supply is used to power the T6963 and LCD
interface logic. The -12volt is used to control the contrast of the
display. The contrast voltage actually varies with temperature and
display, so the application notes recommend using a poteniometer as a
simple voltage divider. The typical negative voltage actually supplied
is about -9 volts.
Another oddity buried in the specifications and
notes is the power, reset sequence. Most micro-controllers such as the
T6963 have a RESET line to initialize them after power up. This can be
applied with a special circuit or by the processor. If you take a close
look at the T6963 application note from Toshiba you will find that in
addition to applying reset you must also hold the VEE supply at ground
during reset. You do not have to implement the sequence under processor
control. Simply use your jumper wire connections on the protoboard to
implement this process.
- Make sure 5 volts is supplied.
- Disconnect VEE from the negative supply and connect to ground.
- Connect RESET to ground (logical 0). Wait for several
milliseconds or more. (this is a joke)
- Disconnect the RESET line from ground. You do not need to connect
the RESET line to anything when you are not connected to ground
(reset). The T6963 has an internal pull up resistor that holds it out
of reset until you connect to ground.
- Connect VEE back to the negative supply
You can implement this process with toggle switches if you like, but
simply switching jumper wires on the board will work.
General Manufactures Spec for DMF Series
Displays
A lenghthy document on the DMF series displays from
Optrex.
Optrex DMF5005 Specification
The manufactures specificaiton for the DMF5005
DMF5005 Pin Assignments
Manufactures pin assignment specificaiton.
T6963 Controler Spec/Dat
Sheet from Toshiba
Manufacturers Specification
T6963 Application Note from Toshiba
Toshiba application note, very usefull.
T6963 Application Note
An applicaiton not from Steve Lawther.
Hitachi
T6963 Application Note
An application note from Hitachi on how to use the
T6963 controller. Application notes are great for getting down to
business fast, but may not represent all then issues for your
application.
Hantronix T6963 Applicaiton Note
Another application note.
Some
helpful hints and errata from a past 373 student working with the
DMF5005
A past 373 student how worked with the display for
the first time overview the approach to developing the display
interface and highlights a few subtle issues. Note, if you are using
the IO expansion board you do not need the 100 ohm resistor recommended
in this document.
Keypads
Keypad Matrix
Matrix
switches are a very common means of providing input and are ubiquitous
in common applications. Hopefully there will be one on the lab door
soon for "keypad entry". The keyboard on your laptop or workstation is
a matrix switch. Cash registers, car door locks, calculators, cell
phones, and the list goes on. A switch matrix is just that, a series of
switches arranged in rows and columns. When a switch is depressed, the
respective row is connected to the respective column. Sensing is
accomplished by applying a logical 1 to a column and then reading the
rows to see which is switch is depressed. By successively applying
logical 1s to successive columns you can scan the entire matrix. You
can of course apply logical 1s to the rows and read the columns if you
wish. The keypad matix has a single row header that can be plugged into
the protoboard. You will have to read the spec to get the pin
description of the kepad.
Kepad Specification Jameco169244
Actuators
Servos
Standard
medium duty Futuba and Hitachi
servos are available. Servos are great accuators for implementing
angular displacement from about +/- 60 degrees. They are controlled by
applying a pulse from about 0.7ms to 1.7 ms every 100ms. The pulse can
be created using general purpose timers as you did for the motor
control lab.
A servo may also be used as a sort of binary
mechanical control. For example, if you want to open/close a gate or
valve, the servo can be controlled for 0 to 90 degree displacements.
The servo requires just power, ground and the
control pulse. The wires are coded as follows:
Ground
--------- Black
5 volts ----------- Red
control pulse ----- yellow or white
The IO expansion 5 volt supply will drive the servo
and the buffered IO port of the IO expansion board will drive the
control pulse.
There are modified servos available that will rotate
360 degrees, but without the angular precision. They are good for low
speed, low torque applications where low rotation rate control is
desired.
DC Motors
DC motors are of course useful for many
applications. As you discovered in the motor control lab, the speed can
be controlled by varying the voltage with pulse width modulation.
Generally, small inexpensive DC motors like the ones used in the motor
control lab do not have much torque at low speeds. If you need torque
at low speeds, a special motor may have to be acquired.
The buffers in the IO expansion board will not drive
the DC motors. An interface circuit like the one used in the motor
control lab will be needed to control the motor. Unlike the motor lab,
you will not need the first transistor stage (2N3904) if you use the IO
Expansion board.
H-Bridge
If you need to control the direction of
rotation, you will need to reverse the voltage polarity across the
motor. This is accomplished using an H-Bridge. This is an ingenious FET
switch that with a few digital control lines allow you switch polarity.
You may also pulse modulate the H-Bridge for speed control.
DC motor
Acroname
Link on H-Bridge Function
Manufactures Specification for the H
Bridge Device SN754410
Specification for the H Bridge including pin
assignments, max voltage rating, etc.
The SN754410 control lines can be driven directly from the IO Expansion
board. Standard small DC motors like the one used in the motor control
lab can be powered by the IO Expansion Board. However, an additional
supply may be required depending on the motor load.
Gear Motor
If you have an application that requires a
lot of torque, but not quick response a gear motor can be used. This is
simply a dc motor with a gear box. They turn slowly with a lot of
torque. They are generally controlled with simple on/off control. The
motor requires a considerable amount of current, so you will have to
use a FET to buffer like you did for the motor control lab. Unlike the
motor lab, you will not need the first transistor stage (2N3904) if you
use the IO Expansion board. If you want
to know position, you may have to encode angular displacement my
counting reflective marks with a light sensor or implementing a limit
switch at the desired angular displacement (position).
Sensors
Ultrasonic Distance Sensor
Daventech SRF04
Distance is
measured with an ultrasonic
distance sensor by measuring the time an ultrasonic pulse travels from
the emitter to target to receiver. The device is triggered by applying
a "start pulse" and then waiting for the return pulse. The start pulse
can be created with a programmed IO write and the return pulse can be
applied to a external interrupt. The time can of course be measured
with general purpose timers. Range is about 3cm to 3m. The target has
to be large enough to produce a good reflection. See the specs for
timing, scaling and pinout.
Infrared Distance Sensor
These sensors produce an analog voltage that
is proportional to distance. The targets can be relatively small, but
must be reflect infra red light. If the object you are measuring is a
poor reflector small reflective tape can be used. The sensors come in
about three varieties that trade off resolution for distance. The
analog voltage is not particularly linear either. So, depending on your
application you may have to "linearize" the output with a piece wise
approximation table in software. See the specs for pinout and voltage
to distance scaling. You may have to characterize (measure the voltage
response) the sensor for you application.
Range Finder Manual
Nintendo Game Controllers
Nintendo 8
The
Nintendo 8 controller is a simple, but
adequate controller for many game applications. Logically speaking, the
N-8 is basically an 8 bit shift register. A latch pulse is sent to the
controller to latch all 8 switch positions into the shift register. A
clock pulse is then applied to shift out the readings from the latch
phase. Since the data is reported serially, you will have to create
some sort of serial to parallel conversion function. Since Nintendo
does not provide an official spec, you will have to use specs provided
by hobby enthusiast. The specs provide pin descriptions, voltage levels
and timing. Note, the timing specifies the timing the game box expects
to see. The controller will actually respond to slower clocks. Lastly,
there are two types of N8 controllers available in the lab. One is the
original controller and then other is generic model. The generic model
works just fine, but the wires are colored coded differently then the
original controller. See the eecs270 N8 lab linked here for these
details and other information.
270 N8 Lab
Cornell
Project
MIT Link
Nintendo 64
The
Nintnendo 64 controller offers a bit more
control then the N8 with more action buttons and an analog (continuous)
joy stick. The controller is more difficult to interface to requiring a
bi-directional serial bus and implementation of a bus protocol. Once
again, Nintendo is not in the business of providing the 373 lab or
others with controller specification. However, many hobbyist have
deciphered timing, voltage levels and controller protocol. Be sure to
see these links and do not hesitate to shop around the web. There are
many sites ranging from amateur to academic with useful information.
Cornell
Project
This link contained a link to one of the best sites
on the N64. Unfortunately, that site is no longer available. There is
good info on basic proctocol and serial timing.
Interfacing the N64 to the 373 IO
Expansion Board and more
What you need to know about the physical and
electrical interface to the IO exapnsion board Also, a litle on
protocol, serial timing and a few debugging tips.
Command Encoding and a Little
on Controller Protocol
More
on Protocol, Timing, Pinouts, etc
Another Good General Purpose Reference