Ecx4436 Tma2
Ecx4436 Tma2
• Use the ASM51 Assembler and the MCU8051IDE/8052 simulator to verify your ALP.
• Submit your written assignment on or before the due date given in the LMS.
• You should be prepared to quiz during the second laboratory session based on TMA #2.
[Q1]
(a) With aid of diagrams, describe the key differences in interfacing a DC motor vs a stepper
motor with an 8051 microcontroller.
(b) Describe the protective mechanisms/components/devices used in interfacing
microcontrollers with motors, supported by diagrams.
(c) Write an ALP to effectively control a stepper motor, addressing the following aspects.
(d) Write an ALP to control the speed of a DC motor at 25%, 50%, and 75% of its full speed
using PWM. You can assume the frequency.
[Q2]
Design and implement an analog data acquisition and control system using an 8051
microcontroller, an 8-bit ADC, and an 8-bit DAC. Your system should meet the following
requirements.
▪ Interface an 8-bit ADC (e.g. ADC0804) to read an analog voltage in the range of 0-
5V.
▪ Interface an 8-bit DAC (e.g. DAC0808) to output an analog voltage in the range of
0-5V.
▪ Sample the ADC input every 100ms and store the last 10 readings in memory.
▪ Calculate a running average of the last 5 ADC readings.
▪ Output the running average to the DAC.
1
1. Draw a detailed block diagram showing all connections between the 8051, ADC,
DAC, and any other required components.
2. Create a flowchart for the main program logic.
3. Write assembly language code to initialize and interface with the ADC and DAC.
4. Implement the data storage, averaging, and alarm trigger functionality in assembly
language.
5. Evaluate the limitations of this system in terms of sampling rate, resolution, and
accuracy. Suggest improvements to overcome these limitations.
[Q3]
(a) Compare and contrast the different types of memory used in 8052-based systems. Provide
example assembly language programs (ALPs) to demonstrate access to each memory
type.
i. XRAM (External RAM)
ii. IRAM (Internal RAM)
iii. SFR (Special Function Register) memory
(b) Design a memory system for an 8052-based microcontroller that requires 32KB of ROM
and 16KB of RAM using 2KB ROM chips and 4KB RAM chips.
i. Calculate the required width of the address bus and data bus. Show your calculations
clearly.
ii. Draw a detailed block diagram of your memory system design, including,
▪ The 8052 microcontroller
▪ All necessary ROM and RAM chips
▪ Address decoders
▪ Data and address bus connections
▪ Chip select (CS), read (RD), and write (WR) signals
(c) Explain how you would implement the address decoding logic to select the appropriate
memory chip based on the address.
[Q4]
(a) A student is configuring an 8051 microcontroller for serial communication with a crystal
frequency of 22.1184 MHz. If they want to achieve a baud rate of 19200, calculate the
required timer values. Explain why this crystal frequency is commonly used in serial
communication applications.
(b) Develop an Assembly Language Program (ALP) for the 8051 to continuously send the
string "TEMP:23.5C" to a data logger every Y seconds, where Y is the first digit of your
registration number. Use the following communication parameters; 4800 bps, 7 data bits,
1 start bit, 2 stop bits, and even parity. Include error checking in your code to ensure
successful transmission.
2
(c) Draw a block diagram and explain the implementation of a multi-device network using the
8051's serial mode 3. The network should include (Z+3) devices, where Z is the first digit
of your student ID. Discuss how you would handle device addressing and collision
avoidance in this network.
[Q5]
(a) You are expected to search the internet and find the suitable devices (sensors, transducers,
and/or actuators) that need to be interfaced with 8051 for the following. Justify your
answers.
i. To measure the weight of an object.
ii. To check whether the object availability at a point.
iii. To check the object, reach its desired position.
(b) List the model or type, measurement range that can be made, accuracy, price, and the type
of the output signal of the devices mentioned above in Q5. (a)
(c) Draw simple block diagrams to depict interfacing the sensors, transducers, and/or the
actuators mentioned above in Q5. (a) with 8051
[Q6]
(a) Research and identify suitable sensors, transducers, and/or actuators that can be interfaced
with an 8051 microcontroller for the following applications. Provide a brief justification for
each selection.
(b) For each device identified in part (a), create a table with the following information.
- Model/Type
- Measurement range
- Accuracy
- Approximate price (in USD)
- Type of output signal (analog/digital, voltage range, communication protocol if applicable)
(c) Draw block diagrams illustrating the interfacing of each sensor/actuator with the 8051
microcontroller. Include the following elements in your diagrams.
- 8051 microcontroller
- Sensor/actuator
- Any necessary signal conditioning circuits (e.g., amplifiers, ADCs, level shifters)
3
- Power supply connections
- Relevant I/O pins on the 8051
(d) For one of the sensors/actuators, write a brief code in ALP demonstrating how you would
initialize the 8051 to read from or write to the device.
(e) Discuss potential challenges in interfacing these devices with the 8051 and suggest methods
to overcome them. Consider factors such as,
- Power requirements
- Signal noise and interference
- Timing constraints
- Calibration needs
[Q7]
Study Automated parking systems on the internet and identify the main electronic units in the
system. Explain the operation of each unit with simple diagrams of the system.
4
Design Project 2022
• Use the ASM51 Assembler and the MCU8051IDE/8052 simulator to verify your ALP.
• Submit your written assignment on or before the due date given in the activity schedule.
Late submissions will not be accepted!
• During the third laboratory session, you should be prepared to face a viva voce examination
based on the design project.
Figure 1 shows the major components of the EDL. The EDL consists of a Keypad, a Bell, an
Alarm, three indicator lights (G-Green, R-Red, and Y-Yellow), and a Motor. There are three
trays to store food. The motor is fixed on the top floor.
The hotel owner initially plans to install the lift for three stories (ground floor, first floor, and
second floor). The default location of the lift is the first floor where the kitchen is located.
Ground and second floor have restaurants. The maximum carrying capacity of the entire lift is
250kg. The person who sends food selects the required floor using the keypad. Subsequently,
the EDL moves to that floor and stops there until the person who receives the food presses the
return button. After closing the door and pressing the return button, the EDL returns to the
default location. With each successful move, the bell should run for 1 second. Otherwise, the
alarm should be on for 5 seconds. The green indicator is on when the EDL is idling. The yellow
indicator is on when the EDL is operating. The red indicator should be on when there is any
failure. The motor needs to operate at constant velocity with 50% PWM for each move.
5
Design Project 2022
State all the assumptions clearly (if any) when answering questions.
[Q1]
(i) For the proposed mechanism, identify suitable sensors and actuators to detect the
following and draw simple block/interfacing diagrams for each to explain your
methodology.
a. To identify the status of EDL reached each floor.
b. To identify the status of the lift's door (whether it is closed or not)
c. To measure and maintain a 250kg carrying load.
(ii) List four (4) features required in a microcontroller for this application and provide
proper justification for each.
[Q2]
(i) Analyse the given specifications/parameters related to the operations/processes of the
EDL and then prepare a Table of resources/features and conditions/constraints required
to design the EDL. (Table should contain, Processes, Sub-Operations, Parameters,
Conditions, Resources, Feature Required of 8051 microcontrollers, and Comments).
(ii) Draw the external view of the system, i.e. A diagram that shows the inputs/sensors and
the outputs/actuators of the system.
(iii)Identify the sub units/sub modules of the system and draw the interconnected block
diagram of the system using the central controller and other required interfacing
devices.
[Q3] Draw a schematic diagram of the system. Clearly show each electronic
components/module. Use any suitable software tools to create a schematic diagram.
[Q4] Draw flowchart(s) to represent the algorithm of the EDL operation. Clearly show the
port mapping of the 8051 microcontrollers. (i.e. Mark the pin connection of each sensor
and actuators used in the EDL).
[Q5] Write assembly language programs (ALP) to perform the above task. (i.e. Q4). Clearly
show the assembly language routines with comments and relation with the flowcharts
drawn in above Q4.
[Q6] Identify the design issues and the necessary improvements of your design.
6
Laboratory Experiments 2022
Aim:
Study the AES-51 development board and execute assembly language programs.
Study the microprocessor interfacing for the AES-51 development board.
Study the advanced microprocessor interfacing techniques and build a real time
application by using 8051 microcontrollers.
Objectives:
Experimental Tasks:
Session #1
Session #2
Session #3
• Assemble and simulate the programs which you written in Design Project.
• Verify ALP by using an AES-51 development board with given external interfacing
circuits/devices.