Micro - Lab Manual Experiments PDF
Micro - Lab Manual Experiments PDF
Micro - Lab Manual Experiments PDF
&
Experiments
Microprocessor lab
By Dr.Hanal Abuzant
And Eng. Asma Afifi
An-Najah National University
12/1/2012
Microprocessor Lab
2. When conducting the lab experiments, the correctness of the wiring and
circuit connections must be verified. The power sources must be
properly turned off. The activation of the power sources must not occur
without the permission of the lab supervisor or the instructor.
3. The setting of the power sources (in terms of utilizing AC or DC) must
be verified.
4. In the event of an evacuation alarm, please stay calm and follow the
instructions of the University general safety committee in this regard.
6. The student must consult the lab supervisor in the case a device stops
working or in the case of an electricity outage.
7. Tampering with the 220V device power lines is prohibited. Do not insert
any object into the openings of the power line adapters or sockets.
3. Students are prohibited from entering the lab premise in the absence of the lab
supervisor or anyone fulfilling that role.
4. It is strictly prohibited to take any lab item or equipment outside the lab without
the permission of the lab supervisor. In the case such permission exists, the
Temporary Loan Form must be filled out duly.
5. The lab time schedule must be observed. It is prohibited to be present in the lab
before or after the designated time slot without prior coordination and permission.
7. The workbenches and tables must be arranged properly before leaving the lab.
8. When in the lab, maintain a serious and responsible conduct and refrain from
joking and any irresponsible behavior.
9. Avoid fiddling with devices that you are not familiar with or ones that you do not
know how to operate very well.
10. Relocating lab equipment is prohibited without the lab supervisor permission.
11. The student must prepare beforehand for any experiment or drill he/she is going to
conduct in the lab.
12. All devices must be turned off as soon as the student is done from using them.
14. The main power safety switch must be turned off when the lab activities conclude.
Unpacking
The module and its accessories are packed in a cardboard box that is used
also to pack the entire equipment after its use.
Table of Contents
1. Introduction ..................................................................................................................................................10
1.1. General presentation ........................................................................................................................................ 10
1.1. Starting the system............................................................................................................................................ 11
1. INTRODUCTION
The main subjects of study that can be faced with the 32 Bit Microprocessor
Trainer are:
• structure of a microprocessor system
• programming of the microprocessor systems
• memory devices
• interface with external devices (serial and parallel)
• analog-digital and digital-analog conversion
• fault research in the microprocessor systems
• examples of interfacing with the modules of the Student-Trainer.
For the starting and use of the system proceeds in the following mode:
The microprocessor starts operating and, after having initialized all the
peripherals, sends the message to the display:
(In the case the message doesn't appear, try to carry out a reset
operation of the microprocessor using the key RESET on the
keyboard).
For doing a simple immersion and starting test of a program, see the
examples of chapter 5.
2. GENERAL DESCRIPTION
2.1 INTRODUCTION
The 32 Bit Microprocessor Trainer is composed of a single card in which
all its components are found.
In this chapter, all the different unit components are described.
For a more detailed description refer to the chapters to come.
The CHIP SELECT used for the selection of the devices, with their
specifics, are shown in the table:
The I/O SELECT used for the selection of the I/O devices. with their
specifics, are shown in the table:
In this unit of the system, there are N.2 connectors present, which are
available at the exterior:
• Connector J3: contains the lines of the three timers of the peripheral
Timer Counter Unit integrated in the microprocessor 80386EX.
Beginning Final
Memory Devices
Address Address
The memories RAM are preset to operate at 16 bit, therefore, there are
always used N.2 memories in couple for the least significant byte (IC7,
IC9) and N.2 memories for the most significant byte (ICS, ICI O).
Address
Function
hexadecimal
350 Writing of codes
351 Writing of data
352 Reading of state
353 Reading of data
Refer to the list of interruption vectors for the use of the display in the
programs that describe the routines present in the monitor that can be
used.
The columns correspond to different 1/O addresses (32E, 32D, 32B, 327), while the lines
correspond to different bit of the data bus (DO, D 1, D2, D3, D4).
Refer to the list of interruption vectors for the use of the keyboard in the programs that describe
the routines present in the monitor that can be used.
This unit contains a parallel interface controller of the type 8255, which gives at disposition N.3
parallel LO ports.
The module Z3 utilizes N.2 ports of 8 bit (Port A and Port B) and N.4 I/O lines coming from
Port C (PCO-PC3 ).
One line of Port C (PC4) is then used for commanding the Buzzer.
See the electrical diagram in the appendix of the manual to consult about the pin-out of the
output connector.
This unit contains an A/D converter and a D/A converter of 8 bit. Manages input and output
analog signals within the field 0-8 Volt.
The A/D conversion is done using the IC17 (ADC0804), which is connected directly to the
section of 8 bit (DO-D7) of the microprocessors bus.
The D/A conversion uses the IC18 (74374) as a latch for the data coming from the bus DO-D7 of
the microprocessor, and IC19 (DAC0800) for the D/A conversion.
This unit contains logic probes, together with the corresponding LEDs for state visualization.
• N.8 logic probes TTL (0-5V), called DO-D7, with the corresponding signaling LED
DO-D7, that can be connected simultaneously, by means of a dedicated cable of 8
test-points.
• N.1 logic probe TTL, called DH, equipped with pull-up resistance, with the corresponding
signaling LED, DH.
• N.1 logic probe TTL, called DL, equipped with pull-down resistance, with the
corresponding signaling LED, DL.
• N.1 logic probe TTL, called DS, which acts on the transitory signals, with the
corresponding signaling LED, DH and with reset key RES-DS.
This unit contains the connector for the connection to the unit IPES Mod. SIS 1, SIS2 e SIS3
which manage the introduction of faults.
The faults can also be managed in a local mode by means of the dipswitch sDP 1 and DP2.
In normal conditions, without faults, DP2 has to be set all in ON, while DPI has to be set all
in OFF.
See the Teacher Appendix `Faults Management' of this manual for the detailed description of
foreseen faults.
3. 1 INTRODUCTION
The MONITOR is the program, installed at the interior of the EPROM of
the system, which supplies the system management and allows the user to
work with it. Its fundamental functions are:
• Visualization and modification of memory and registers
• Continuous execution, step by step, with program breakpoints
• Loading programs from keyboard and from PC.
The interaction with the user is done by means of keyboard and display.
3.2. KEYBOARD
The keyboard locks like in the figure:
NOTE.
The microprocessor 80386 addresses a high quantity of memory. The
devices (RAM and EPROM) present in the system do not occupy all
this memory.
If trying to access, during the use of the Monitor commands, to non
occupied memory cells from the RAM or from the EPROM, the
system gets blocked, since the microprocessor sets itself to wait for the
READY signal from the external memory (which is obviously not
present).
In these cases, it's necessary to carry out a reset of the system in
order to return to the command mode.
This key has a double function. The function CHG (Change) allows
entering in modification session of a value eventually present on the
display (contents of a register, memory location, ..) the function RET
(Return) allows ending the modification session. the modification session
is made evident by the presence of the cursor on the display.
The ARROW keys allow moving the cursor during the modification
session.
16 Keys Hexadecimal/Command Section.
The 16 keys in this section have a double function.
Number Function. Corresponds to the 16 hexadecimal numbers 0-F
during the modification sessions (the modification
session can be entered with the key CHG/RET).
Command Function. Allows giving the commands to the Monitor when
the system is not in modification session (the
modification session can be exited with the key
CHG/RET).
Once the address of interest has been inserted, the key CHG/RET has to
be pressed in order to end the modification session. On the display
appear at this time the specified address and the corresponding data, in
the form:
code.
The number, which appears after the letter 'h", represents the data in
hexadecimal form.
The possible commands at this time are the following:
• To pass to the successive cell: press INC(+)
• To pass to the preceding cell: press DEC(-)
• To pass to the first RAM user cell: press FIRST
• To pass to the last RAM user cell: press LAST
• To modify the displayed data: press CHG/RET
• To end the modification: press ClHG/RET.
After having pressed the key, the first register appears on the display:
After having pressed the key, the first segment register appears on the
display:
Once the address of interest has been inserted, the key CHG/RET has to
be pressed in order to end the modification session. On the display appear
at this time the specified address and the corresponding data, in the form:
The modification session is entered with the cursor in the first position of
the hexadecimal data to insert in the indicated memory site.
Once the data has been inserted, the key CHG/RET is pressed which
memorizes the data, increments the memory site, and gets ready for new
data insertion.
The insertion operations are terminated with the key RESET.
Once the program's departing address has been inserted, the key
CHG/RET has to be pressed. this time the execution of the program is
launched starting from the specified address.
After each step of the program, it stops, displaying the memory to which
it has arrived:
it's possible at this time, examining the contents of the registers and of the
memory.
4. SOFTWARE INTERRUPTS
4.1 INTRODUCTION
The Monitor of the system contains at its interior the management
software of the different peripherals of the 32 Bit Microprocessor Trainer.
In this chapter the different interruptions are described; their functions and
the required parameters.
In all the examples of this manual, the interruption software will be
employed for the management of the system's peripherals.
INPUT none
OUTPUT none
Altered
none
Registers
INPUT none
OUTPUT AL= key code pressed (0-18)
Altered
none
Registers
OUTPUT none
Altered none
Registers
Wait in milliseconds.
This interruption provokes a wait, before the return, equal to the number
INT 0DH of milliseconds specified by the contents of register AX in input:
OUTPUT none
Altered
none
Registers
INPUT none
OUTPUT AL = result of the conversion
Altered
none
Registers
INPUT BX = duration
CX = frequency
OUTPUT none
Altered none
Registers
AH = 0 : Programming ports
Register AL Programming
Bit 0 = 0 : port A in output
= 1 : port A in input
Bit 1 =0 :port B in output
= 1 : port B in input
Bit 2 = 0 : port C (CO-C3) in output
= 1 : port C (CO-C3) in input
The contents of AL in output correspond to the data read from the port.
Register AL Programming
Bit 7,6,5 Baud rate
= 000 : 1200
= 001 : 2400
= 010 : 4800
= 011 : 9600
(use the baud rate 1200 for the
controllers UMB 8250)
Bit 4,3 Parity
=
00 : no
= 01 :odd
=10:no
= 11 :even
Bit 2 Stop Bit
=0 :1
=1 :2
Bit 1,0 Word length
=10 : 7 bits
=11 : 8 bits
AH = 1 : Transmission of a character
The contents of AL determine the character to be sent.
Before sending character, the routine waits until eventually other
preceding characters have been transmitted.
AH = 2 : Reception of a character
The contents of AL determine the received character.
The contents of AH determine the present state of the line and of the
modem.
5.1 CONSOLE
The console of Module Z3/EV is composed of the keyboard and the
display.
5.1.1 Keyboard
Refer to the electrical diagram of fig. 5.1.1 .
For each one of these addresses, the buffer IC26 (74244) is enabled,
which allows reading by means of the lines D0-D4, the situation of the
keys (D0 corresponds to the highest key of the column).
In the Test-Points Rl, R2, R3, R4 and R5, the situation of the lines read
by means of the buffer IC26 is shown.
RI corresponds to the highest line of the keyboard, R5 to the lowest one.
An example of a program that reads the keyboard and visualizes the key
code is shown (its number) in hexadecimal form on the display.
5.1.2 Display
Refer to the electrical diagram of fig.5.1.2 .
It's a LCD display composed of 1 line of 16 characters and driven by an LSl internal controller.
Receives the commands and the data directly from the data bus and uses the following address
lines:
Address
Function
hexadecimal
350 Writing of the codes
351 Writing of the data
352 Reading of the state
353 Reading data
The codes that can be used with the various functions, are shown next:
For the direct programming of the LCD display by means of its codes,
please refer to its data sheet.
Port Use
Port A, bit A0-A7 Available at pins 15-22 of connector J I
Programmable ininput or in output
Port B, bit B0-B7 Available at pins 7-14 of connector JI
Programmable in input or in output
Port C, bit C0-C3 Available at pins 5-3-23-25 of connector JI
Programmable in input or in output
Port C, bit C4 Command of the buzzer
Programmed in output
Also for this peripheral, if you want to program directly the chip 8255
for its use, refer to its data-sheet.
The monitor of the system contains on the other hand, the following
interruptions software for the management of this interface:
Connect the test-points A0-A7 of the Parallel F0 Unit with the test-
points D0-D7 of the Logic Probes Unit, by means of the issued cable,
for the direct visualization of the port A (in the same way for port B).
The serial interface is provided with a connector D9 (J2), identical to the connector serial interface
of the IBM compatible Personal Computer.
The registers mentioned above can be used directly for the writing of
communication programs,. In this case, refer to the controller 8250
datasheet for the details.
Next, N.2 programs are shown; a transmission and a reception one. for
the serial connection with a peripheral.
The line INTR# is connected to the input INT0 of the microprocessor and
to the input A0 of the buffer IC21 (address 32EH).
It's possible thus to use the A/D converter with Interrupt or Polling
techniques.
ICIE3
The converter DAC0800 is not provided with an internal latch, and therefore cannot be connected
directly to the bus of the microprocessor.
Therefore, the latch 74374 (IC 18) is used, connected to address 0300H, in order to supply the 8
bits to the converter.
The 8 bits are available on the test-points D0-D7 of the Analog I/O Unit. The converter transforms
the input digital information in an output current value on the pin IOUT.
This current is transformed in a voltage value within the range (0-8 Volt) of the operational
amplifier IC20.
For the command software of the D/A converter, it's necessary only to send the output data to the
Port with address 0300H.
The Monitor of module Z3/EV renders available the Interruption Software INT 0FH, which
facilitates the use of the A/D converter at the interior of the programs.
MENU EDIT: Undo, Cut, Copy, Paste, Delete, Find, Find Next, Replace
These commands allow writing the programs with all the functions of any
edit program for Windows, as NotePad, WordPad, etc. .
MENU COMM
This section allows transferring the programs in machine code
corresponding to the source file, which is presently active.
If, for example, the file PROVA.ASM has been opened, the file
PROVA.BIN or PROVA.EXE is transferred to Module Z3/EV.
For the generation of the file PROVA.BIN it's necessary to proceed using
the assembler MASM Microsoft, with the following commands:
MASM PROVA;
LINK PROVA; EXE2BfN
PROVA.EXE PROVA.BIN
These commands can be automated with the options of the Utility menu.
This command allows transferring a program to Module Z3/EV using the serial interface
RS-232 of the Computer and of the Module.
The computer and the Module Z3 (connector 72) have to be connected together using the
adequate issued cable.
The transmission is done at the speed of 1200 bit/s, without parity, with 1 stop bit and with 8
bit/character.
Before the transmission, it appears a Dialog Box where it's possible setting the requested
parameters.
In particular:
• The interface used: COMI, COM2 and the other communication parameters.
• The directory where the transfer program resides
• The extension of the transfer file. It can be BIN in case the program EXE2Bin is
used to convert the file generated from the Linker, otherwise it can be EXE in case
the file generated from the Linker is directly used.
• The skipping of bytes in the file to transmit. This is important in case the files EXE
are used, which normally contain in the first 200H bytes, information which serve
only in MS-DOS environment.
This command allows transferring a program to Module Z3/EV using the parallel interface
of the Computer and of the Module.
The computer and the Module Z3 (connector J2) have to be connected together using the
adequate issued cable.
Before the transmission, it appears a Dialog Box where it's possible setting the requested
parameters. In particular:
• The interface used: LPTI, LPT2, ..
• The directory where the transfer program resides
• The extension of the transfer file. It can be BIN in case the program EXE2Bin is used to
convert the file generated from the Linker, otherwise it can be EXE in case the file
generated from the Linker is directly used.
• The skipping of bytes in the file to transmit. This is important in case the files EXE are
used, which normally contain in the first 200H bytes, information which serve only in
MS-DOS environment.
MENU UTILITY
This menu contains the commands for the direct execution of the assembling operations from the
application MODZ3, Linker and binary conversion of the program.
This command sets the parameters for the execution of the assembling operations, Linker and
binary conversion.
• Assembling command. It is counseled to specify a file batch (ex. MASM.BAT) where the
command for starting the assembler is written. A possible file batch of this type contains
the instructions: masm %1,,%I,;
pause
• Linker command. It is counseled to specify a file batch (ex. LINK.BAT) where the
command for starting the link is written. A possible file batch of this type contains the
instructions:
link %1;
pause
• Binary conversion command. It is counseled to specify a file batch (ex. EXE2BIN.BAT)
where the command for starting the conversion programs is written. A possible file batch
of this type contains the instructions:
exe2bin %l.exe %1.bin
pause
Starts automatically the assembling command giving as parameter the name of the active
program.
Starts automatically the linker command giving as parameter the name of the active
program.
Starts automatically the binary conversion command giving as parameter the name of the
active program.
The operative system MS-DOS normally comprises a program (EXE2BIN.EXE) which has
this finality.
In some computers the program EXE2BIN is not available in the DOS version
installed.
In this case the binary conversion is abandoned and the file EXE is used directly (remember
in this case to skip the first 512 bytes of the file).
This command opens a window on the video, where it's possible visualizing the list of the
assembled program (obviously if the file generated by the assembler NomeProg.LST is
present).
This command opens a window on the video, where it's possible visualizing the binary code
of the active obviously if the file NomeProg.BIN is present).
These informations are important since they are the ones to be inserted in the memory of
Module Z3, whenever the program is charged directly from the keyboard.
The codes are visualized starting from address OOOOH.
When they have to be inserted into Module Z3, it's necessary to start with the address
where the program will be actually put (normally 0000:0800H).
7.Experiments
Experiment 1: Basic Input Output
Experiment 2: Analogue to digital converter
Experiment 3: Keypad scanning
Experiment 4: Digital to analogue converter
Experiment 5: Strain gage and temperature sensor acquisition
Experiment 6: Ultrasonic transmitter and receiver
Experiment 7: DC motor control
Experiment 8: Stepper motor control
Experiment 9: Stepper motor positioned
Read the user manual and explore the 32 bit Microprocessor Trainer (Module Z3/EV) that
based on 8036 Intel.
Objectives
Carry out the IN/OUT digital operations (ON or OFF states) manually or
using a microprocessor system.
Equipment
needed
• Power supply unit PS
• Experiment module F04/EV
• Application board F04-1 lEV
• Multimeter
Digital IN:
The logic state of the 8 IN lines is selected with the 8 switches I0 - I7. The
switch I8 must be in SWITCH position. In this way, the integrated circuit IC3
(74HC244 – octal tri-state buffer) is enabled and so the 8 lines are available to
be acquired (Port B).
For the integrated circuit 74HC244, if the lines 1 and 19 are to the low logic
state, it behaves as buffer and takes the logic levels applied to the inputs back to
the outputs. These levels are then made available for the external acquisition
port (Port B). If the lines 1 and 19 are to high logic state, the outputs are
electrically separated because they have high impedance and so the whole
switches section is separated from the rest of the circuit. This need appears when
using the A/D conversion input. The logical data obtained by conversion are not
altered by the state of switches I0-I7.
Digital OUT:
The digital data shown by the external unit (I/O ports of a microprocessor,
interface cards ...) are transferred by means of the integrated circuit 1C6
(74HC244) and then displayed with the set of leds.
The integrated circuit 74HC244 shows the lines 1 and 19 to the low logic
state and behaves as standard buffer, taking the logic levels applied to the input
back to the output.
The Experiment
• Connect the application board F04-l/EV to the parallel IN/OUT ports of the
microprocessor system through the proper 26-line flat cable
• Check that the switch I8 is turned to SWITCH
• Disconnect the 8 jumpers Jl-J8 otherwise the same function will be carried out
by the hardware of the same module.
• Write an assembly program that reads the digital input lines that can be changed
-
with the switches I0 I7 and reports the same logical values to the output ports
after a little delay through the 8255 controller. (see the data sheet of 8255)
Objectives
Convert analog variables into digital
Equipment
needed
• Power supply unit PS
• Experiment module F04/EV
• Application board F04-1 lEV
• Multimeter
Introduction
The application board BINARY I/O and A/D D/A CONVERTER basically
consists of two sections, one for the DIGITAL/ANALOG conversion and the
other for the ANALOG/DIGITAL one.
The A/D conversion section is made with an A/D 8-bit dedicated converter
with 8 bits which outputs can be directly interfaced with the data bus or IN ports
(OUT of latch, tri-state kind).
The analog input voltage (0-8Vdc) is converted into a digital range variable
between 00H and FFH.
To guarantee a higher flexibility of use, the outputs are made more stable
by an 8-line buffer and so they can be acquired externally by means of a
microprocessor system.
Electrical diagram
(See the schematic of the BINARY I/O and A/D D/A CONVERTER board
F04-1/EV in the APPENDIX B: Description of the electrical diagrams)
The effective input line of the voltage to be converted is protected from
overvoltages with the two diodes D1 and D2.
The transistor T1 properly initializes the start up converter (at start up the
pulse is to ground at the input 5 as well as the input WR) and guarantees the later
continuous conversion (the converter can be used in direct connection with a
microprocessor).
The integrated circuit IC2 (74HC244) has 1 and 19 lines to low logic state
and behaves as normal buffer, taking the input logic levels back to the output
and enabling the acquisition from an external system (I/O ports of a
microprocessor, interface cards...)
The switch I8 must be to A/D position so to enable IC2 and force the
outputs of IC3 to a high impedance state; in this way the state of the switches I0
- I7 does not change the logic state of the lines from the A/D converter.
The Experiment:
• Connect the application board F04-l/EV to the parallel IN/OUT ports of the
microprocessor system through the proper 26-line flat cable
• Connect the IN/AD input of the module to a power supply with variable output
0-8V dc
• Check that the switch i8 is turned to A/D position
• Write an assembly program that reads the A/D converter from port B and
displays the digital values
o On the 8 leds through port A.
o On the LCD.
(Hint: use the system interrupts that explained in the manual)
Objectives
Detect keystrokes from a keypad (keypad interface
program)
Equipment needed
• Power supply unit PS
• Experiment module F04/EV
The Experiment:
• Write an assembly program to implement the keypad scan algorithm.
• Each time a key is pressed on the keypad, the program should display the key
that was pressed on the LCD.
(Hint: refer to the user manual to use the addresses of the keypad columns, and to use the system
interrupts to handle the LCD
Objectives
• Convert digital variables into analog one
• Use keypad to control rises and falls in voltage
Equipment needed
• Power supply unit PS
• Experiment module F04/EV
• Application board F04-1 lEV
• Multimeter
• Oscilloscope
Introduction
The application board BINARY I/O and A/D D/A CONVERTER basically
consists of two sections, one for the DIGITAL/ANALOG conversion and the
other for the ANALOG/DIGITAL one.
The D/A conversion section is used by interfacing to the microprocessor
system. The values between OOH and FFH across the input are converted into a
corresponding value ranging between 0-8Vdc.
The logic state of the digital input values (port A) is displayed with a set of
8 leds.
Electrical diagram
(see the schematic of the BINARY I/O and A/D D/A CONVERTER board
F04-1/EV in the APPENDIX B: Description of the electrical diagrams)
The D/A converter IC4 receives the 8 digital lines (port A) directly to be
converted. These are usually shown by some external digital unit (I/O ports of a
microprocessor, interface cards...)
The conversion is made instantly and the resulting voltage value is present
across the output of the operational amplifier IC5. With the calibration trimmer
RV3, the offset voltage of the amplifier is compensated while with RV2, the
analog output range is fixed between 0 - 8Vdc.
The Experiment:
• Connect the application board F04-l/EV to the parallel IN/OUT ports of the
microprocessor system through the proper 26-line flat cable
• Check that the switch I8 is turned to SWITCH position
• Disconnect the 8 jumpers Jl-J8
o Write an assembly program to perform the digital to analog conversion and
use the keypad (buttons 3 and 7) to control rising and falling in output
voltage. Check the voltage using the multimeter.
o Write an assembly program to generate square, saw and sine waves,
display them using the oscilloscope.
o Use the keypad (buttons 3 and 7) to increase and decrease the width of the
signals above.
(Hint: use the system interrupts that explained in the manual to handle the LCD)
Objectives
• To analyze the characteristics of the force transducers and the signal
conditioners usually employed with this kind of sensors.
• To analyze the characteristics of temperature transducers and signal
conditioning circuits normally used with these sensors.
Equipment needed
• Power supply unit PS
• Experiment module F04/EV
• Application board F04-1 lEV
• Multimeter
Introduction
The application board STRAIN GAGE and TEMPERATURE SENSOR
consists of two sections one for each transducer (device for producing an
electrical signal from another form of energy).
Strain Gage Sensor:
U
The power sensor used is a strain gauge of universal use; it can be used for
general deformation analysis and mechanical stress in engineering field.
The operating principle is based on the correlation between percentage
elongation and resistance variation induced by the sensor. The obtained
resistance variations are very low. The sensor used in the application board,
with a weight of 5 Kg applied to the mechanical support it is attached to, has a
variation of 0.005Ω. To measure such small voltage variations, a bridge circuit
is used where the unknown resistance of the strain gauge strip is measured by
comparison to the other resistors. The bridge unbalancing is detected with a
differential amplifier to obtain the wished voltage range at the output.
Temperature Sensor:
U
Electrical diagram
Strain Gage:
As the resistance variations of the sensor are very low, the voltage
variations are very low and can hardly be measured with a normal multimeter
(µV).
With a voltmeter you can measure the voltage amplified by 10 which can be
detected at the output of the differential amplifier IC1 which takes a value of
some mV.
As the voltage value is too low for the acquisition, it is amplified further by
IC2 for about 350 times, so to obtain a voltage of +lVdc at a pressure of approx.
1 kg exerted on the support connected to the sensor.
Temperature Sensor:
U
Objectives
• To analyze the emission characteristics and the driving circuits of an
ultrasound generator.
• To analyze the reception characteristics and the circuits of an ultrasound
receiver.
• To evaluate the use of the ultrasound transmitter and receiver as presence or
distance detector of a barrier set near the transmitter.
Equipment needed
• Power supply unit PS
• Experiment module F04/EV
• Application board F04-1 lEV
• Multimeter
• Oscilloscope
Introduction
The ultrasound transmitter/ receiver application board consists of two
sections, one to drive the transmitter and the other to receive the ultrasounds.
The ultrasound transducer consists of a ceramic tablet which oscillates in
case it is powered with a sine signal with frequency corresponding to the
resonance (usually 100 kHz and 5000 kHz). Similarly, the receiver uses the
resonance effect of a ceramic tablet to generate a signal when ultrasounds are
picked up.
Detection system of an obstacle:
U
Electrical diagram
Transmitter:
U
With the next low-pass filter, the ultrasound transducer is applied a sine
wave-form with 40 kHz-frequency.
Receiver:
If an obstacle is set near the ultrasound transmitter, the signal is reflected
and then intercepted by the receiver.
The signal detected by the ultrasound microphone is amplified by 3 cascade
stages (IC2 - 4069). This signal starts a monostable which keeps the output to
high level for a fixed time if an obstacle is detected.
The output of the monostable IC3 enables the acquisition of the receiver
state, with an IN line of a microprocessor system.
The Experiment
Connect the ultrasound transmitter/ receiver application board to the
parallel IN/OUT ports of the microprocessor system through the proper 26-line
flat cable
Write an assembly program to do the following:
• Reading of the ULTRASOUND receiver state using the line B0, and transmitter
enabling and disabling using the line A0.
Pushing INC(+)/3 the transmitter lights on and so does the green led on the
transmitter (GENERATOR). Rx=ON or Rx=OFF appears by setting an obstacle
over the sensors TX and RX on the LCD display of module Z3/EV. If the
transmitter is switched off with DEC(-)/7, Rx keeps obviously always OFF
Objectives:
• To analyze the motor operation in d.c.
• To analyze the PWM driving technique applied to a d.c. current motor
• To analyze the operation of an optical transmitter-receiver system
• To study the frequency-voltage conversion systems
• To analyze the application of an optical transmitter-receiver system for reading the speed of a motor
Equipment needed:
U
Introduction:
U
PWM Control
The application board D.C. Motor control consists of two sections, one for driving the D.C. motor
and a second for reading the speed with an optical transmitter - receiver system. The PWM switching
technique is used to control the D.C. motor. It is powered by a rectangular behavior voltage with constant
period T and variable duty cycle.
PWM control diagram
The voltage Ve is compared which depends on the speed set-point to a saw-tooth voltage (or
triangular) Vs with constant frequency generated by an oscillator. The output of the comparator V O is a
R R
rectangular wave with constant frequency and variable duty cycle with the level Ve which drives the
switching of a power section directly connected to the motor.
Motor behavior
The motor characteristics, as concerns the speed and the given torque, basically depend on the
mean value of the applied voltage which depends on the duty cycle.
Optical sensor for speed detection
The disk with transparent body on which opaque radial traces are produced, integral to the motor
axis, enables the light emitted by the TRANSMITTER led to reach or not the RECEIVER photo-sensor.
The output signal generated by the receiver consists of a train of pulses with frequency proportional to the
same speed.
Frequency-voltage converter
The train of pulses generated by the optical RECEIVER is properly squared and then converted
into a signal with voltage variable between 0 - 8Vdc by a monolithic F/V converter.
PWM Oscillator
The Experiment:
U
Speed reading through A/D converter and setting of the SET-POINT value through D/A converter
Part1:
• Connect the OUT (0 output to +8Vdc) of the application board F04- 3/EV to the IN A/D input of the
microprocessor system.
• Connect the IN (0 input to +8Vdc) of the application board to the OUT D/A output of the microprocessor
system.
• By pushing the pushbutton INC(+)/3 the motor speed increases up to a maximum value corresponding to
+8Vdc
• By pushing the pushbutton DEC(-)/7, the motor speed drops until stopping.
• The display of module Z3/EV shows the speed value (00H - FFH)
Part2:
The program reads the speed and applies a simple sum transformation to the detected error,
consisting in the difference between the set-point and the detected speed added to the set-point. This value
is emitted, as variable of the processed output, across the output toward the D/A converter and so toward the
motor.
• Connect the OUT (0 output to +8Vdc) of the application board F04- 37EV to the IN A/D input of the
microprocessor system.
• Connect the IN (0 input to +8Vdc) of the application board to the OUT D/A output of the microprocessor
system.
The display of module Z3/EV shows, the Setpoint (Sp), the speed (Tch) and the output (Out)
Objectives:
• To check the operating principles of a stepper motor
• To analyze the driving of the stepper motor
• To analyze the direct driving of the stepper motor with a microprocessor system
Equipment needed:
U
Introduction:
U
Stepper Motor
The STEPPER MOTOR application board basically consists of two sections, one for the clock
pulses generation and the state defining the motor rotation direction and a second for driving the 4 windings
constituting the inductor of the same motor.
Powering the motor winding in sequence, a rotating magnetic field is created which is followed by
the rotor. The rotation speed is determined by the speed with which the windings are switched and the
rotation direction is determined by the particular switching sequence.
Clock and direction signal
The switching signal can be generated in three ways:
• by a local oscillator (continuous generation)
• with a pushbutton (a pulse at each push)
• with a line connected to an OUT port coming from a microprocessor system (continuous generation)
The motor direction is specified by a fixed logic state line. This line determines the UP or DOWN
counting of a binary counter which powers a binary/decimal counters. The pulses generated by the last
drives the four power stages powering the motor windings with the wished sequence.
The circuit configuration supplies a FULL STEP motor driving. Other kinds of driving can be
carried out using a microprocessor module and driving the power sections of the motor windings directly.
(see the APPENDIX B: Description of the electrical diagrams)
Electrical diagram:
U
(See the schematic of the STEPPER MOTOR application board F04-1/EV in the manual).
With jumper J2 inserted, the bistable oscillator IC1 generates a square wave-form with output
frequency of about 100 Hz.
If jumper J1 is inserted, the control pulse is generated directly with the pushbutton MANUAL
CLOCK. Each time you push it there is a step rotation of the motor. The signal produced with the
pushbutton MANUAL CLOCK is squared by 1C2 so to get a pulse with regular fronts at the output.
With jumper J3 the train of control pulses is generated directly by an output port of a
microprocessor system which can be connected externally.
In the two first cases, the control pulses are directly applied to the UP/DOWN counter IC3 which
shows the corresponding binary valve (QA, QB, QC and QD) in the four output lines.
Only 2 outputs are used as input for IC4 BCD-TO-DECIMAL DECODER which shows a pulse in
correspondence to each binary combination of its inputs only to its outputs 0, 1, 2 and 3 (the others are not
involved as only 2 inputs are used):
BA 0 1 2 3
00 1 0 0 0
01 0 1 0 0
10 0 0 1 0
11 0 0 0 1
The pulses drive the stepper motor windings directly with the corresponding transistors Ti, T2, T3
and T4. The UP/DOWN counting is fixed with jumper J4.
In this experiment, you will write the code for a positioner. The input
to your program is the degree (0 – 360) which determine the angle at
which the motor should be positioned clockwise. For example, if 73
is first entered, the motor will rotate 73 degree clockwise. Then if 28
is entered, the motor will rotate 45 counter-clockwise, that is to the
position 28. Notice that (28 – 73 = -45). If 300 is then entered, the
motor should be positioned at 300, therefore it should rotate 300 – 28
= 272 degrees clockwise.
The control software is provided with the module Z3/EV and this
enables to carry out the following phases, for each program:
• EDITING
• ASSEMBLING
• LINKING
• TRANSFER TO Z3/EV RAM
1) With the EDITOR program included into the development software, the list of instructions
constituting the program is composed in Assembler language. The programs of EDITOR kind
facilitate the insertion, change and possible erasing of the instructions of the whole program.
Usually, to make the insertion of the files name easier, the program name extension is ASM.
To create new programs it is convenient to start from one of the already provided developed
programs; with the EDITOR program integrated into the development software, it is sufficient to
insert only the particular data and instructions, as there are already parts with standard directions.
MEM_POS = 0800H
DS SEG = 0080H
IWAITMS = ODH ; interrupt wait
IBUZZER =10H ;interrupt buzzer command
IPARAL = 12H ;interrupt parallel control
IVIS = OBH ;interrupt LCD DISPLAY
CODE SEGMENT
ASSUME CS:CODE, DS:CODE
ORG OH
START: MOV AX,DS_SEG,
MOV DS,AX ;charge data segment
(Insert the useful program here)
…
…
DEC_Name ENDP
According to the specific program, the list of the Interrupt mnemonics that are used and the used
number of Subroutines can be changed.
2) Once the program in Assembler and the name with extension.ASM are created or changed,
select the icon Asm for compiling. The compiling is carried out in DOS automatically. If there
are syntax errors the following message is shown:
0 Warning Errors
0 Severe Errors
An object file is generated, with extension .OBJ. If there are syntax errors, the related error
messages are displayed with reference to the editing line where they are; (any key must be pressed
to return to the program normal ambient)
3) The related addresses of the program generated by the compiler must be specified with a linker
program. This operation is carried out selecting the icon Link on the file with extension OBJ
obtained across point 2.
The icon Bin must be selected (Exe2bin.exe is entered and a 512-bytes file without preamble is
created).
In this way an executable program is obtained with extension.EXE that can be transferred into the
module Z3/EV.
The communication with the Personal Computer and the module Z3 occurs through the serial line
RS232 and using a proper supplied cable (HALF MODEM):
5) Connect the serial cable between the PC and the module Z3/EV
6) In the module Z3/EV, select the LD-SER/6 key. The module enters
automatically a reception program of the files coming from the PC.
8) For the whole duration of the PC transmission the display of the module
Z3/EV shows this message:
If the program is received properly in the module Z3/EV, this message will
be shown:
TXend, chr:XYZ
where XYZ indicates the length in bytes of the specific transmitted file.
The file is memorized on the address 0000:0800 of the RAM of the module.
Carry out the connection between the Ports A and B of the module Z3/EV and the used
moduleF04-X/EV and check that the module F04/EV is powered .
9) In the module Z3/EV select the RESET key and then RUN/8 to run the program.
o POWER SUPPLY
o 32 BIT MICROPROCESSOR
o MEMORY UNIT