Nothing Special   »   [go: up one dir, main page]

EEX4436 TMA1 Answers (119213310)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

EEX4436

MICROPROCESSORS AND INTERFACING


Tutor Marked Assignment – 1

By

Dinesh Kavinda Sudasinghe


119213310

Submitted to
Department of Electrical and Computer Engineering
Faculty of Engineering Technology
At
Colombo Regional Center

On
12/06/2023.
[Q1]

(a) Embedded Control and Automation: Microcontroller-based systems are widely used in
embedded control and automation applications. They provide the ability to monitor and control
various devices and processes. By integrating sensors, actuators, and other peripheral devices,
microcontrollers can collect data, analyze it, and make decisions in real-time. This makes them
essential in applications such as robotics, industrial automation, home automation, automotive
systems, and many more. The compact size and low power consumption of microcontrollers make
them suitable for embedding in devices and systems with limited space and energy resources.

Versatility and Flexibility: Microcontrollers offer versatility and flexibility in system design.
They are programmable devices that can be tailored to meet specific requirements of an
application. Developers can write software code to define the functionality and behavior of the
microcontroller, allowing for customization and adaptation to different applications. As a result,
microcontrollers are widely used in a wide range of applications, from consumer electronics to
industrial systems.

Cost-Effectiveness: Microcontrollers are cost-effective solutions for various applications.


Compared to more complex systems like microprocessors or dedicated integrated circuits (ICs),
microcontrollers combine the central processing unit (CPU), memory, and other peripherals onto
a single chip. This integration reduces the component count, simplifies the design, and lowers the
overall system cost. Additionally, microcontrollers are available in a wide range of price points.
Their affordability makes them accessible to a wide range of applications, including low-cost
consumer electronics, educational projects, and mass-produced products.

(b) ARM Architecture:


Similarities:
• ARM microcontrollers are known for their energy efficiency, making them suitable for
battery-powered devices and applications.
• They offer a wide range of performance options, from low-power Cortex-M series to high-
performance Cortex-A series, catering to different application requirements.
• ARM-based microcontrollers are highly popular and widely supported, with a vast
ecosystem of development tools, libraries, and community support.
Differences:
• ARM microcontrollers are typically based on a Reduced Instruction Set Computing
(RISC) architecture, which focuses on executing simple instructions efficiently.
• They often feature advanced features such as hardware floating-point units, digital signal
processing (DSP) instructions, and complex interrupt handling mechanisms.
• ARM microcontrollers are commonly found in applications like smartphones, IoT
devices, automotive systems, and high-performance embedded systems.

PIC Architecture:
Similarities:
• PIC microcontrollers are known for their simplicity and ease of use, making them suitable
for beginners and educational purposes.
• They offer a wide range of options, from low-cost 8-bit PIC10/12/16 series to more
powerful 16-bit PIC24 series, according to different application requirements.
• PIC microcontrollers have a dedicated following and a rich ecosystem of development
tools, compilers, and libraries.

Differences:
• PIC microcontrollers use a Modified Harvard Architecture, which separates program
memory and data memory, allowing simultaneous access to both.
• They typically have a limited number of instructions and registers, which simplifies
programming but may require more code space for complex tasks.
• PIC microcontrollers are commonly used in applications like consumer electronics, home
automation, industrial control, and simple embedded systems.

AVR Architecture:
Similarities:
• AVR microcontrollers are known for their low power consumption, making them suitable
for battery-powered and energy-efficient applications.
• They offer a range of options, from 8-bit ATtiny series for low-cost and small-scale
projects to 32-bit AVR32 series for higher performance applications.
• AVR microcontrollers have a dedicated community and a rich set of development tools,
compilers, and libraries.
Differences:
• AVR microcontrollers use a Modified Harvard Architecture, similar to PIC, separating
program memory and data memory.
• They often feature a rich set of on-chip peripherals, including analog-to-digital converters
(ADCs), timers, USARTs, and more, providing enhanced functionality.
• AVR microcontrollers are commonly used in applications like consumer electronics, IoT
devices, automation systems, and DIY projects.

(c) Microcontroller-based systems offer various advantages to engineers in the field of mechatronics,
which involves combining mechanical engineering, electronics, and computer science to create
intelligent systems. These benefits include:
Control and Integration: Microcontrollers act as the central control unit, allowing engineers to
integrate mechanical components, sensors, actuators, and electronic circuits into a solid system.
By programming the microcontroller, engineers can implement control algorithms and logic to
control the behavior of the mechatronic system. This capability enables precise motion control,
feedback control, and coordination of multiple subsystems, thereby enhancing overall
performance and functionality.
Real-Time Processing and Feedback: Mechatronic systems often require real-time processing
and feedback for accurate operation. Microcontrollers can execute tasks quickly, enabling
engineers to process sensor data, implement control algorithms, and generate timely actuator
commands. Real-time processing facilitates quick responses to system changes, supports closed-
loop control, and ensures stability and accuracy in mechatronic applications.
Customization and Prototyping: Microcontrollers offer a high degree of customization and
flexibility in mechatronic system design. Engineers can write software code to tailor the
microcontroller's behavior to specific application requirements. This customization allows for
quick prototyping and development, enabling engineers to experiment, test, and improve their
mechatronic designs efficiently. Microcontrollers also simplify the combination of various
sensors and actuators, enabling the development of complex mechatronic systems.
Connectivity and Communication: Microcontrollers often include built-in communication
interfaces, such as UART, SPI, I2C, and Ethernet, facilitating connectivity with other devices or
systems. This connectivity enables data exchange, remote control, and integration with higher-
level control systems or networks. Engineers can implement communication protocols like
Bluetooth, Wi-Fi, or CAN bus using microcontrollers to ensure continuous interaction between
mechatronic systems and other devices or subsystems.
Power Efficiency and Compactness: Mechatronic systems frequently operate on limited power
sources, such as batteries or small power supplies. Microcontrollers are designed to be power-
efficient, consuming minimal energy while performing their tasks. This characteristic makes them
well-suited for energy-constrained mechatronic applications where power optimization is crucial.
Additionally, the compact size of microcontrollers enables their integration into small-scale
mechatronic systems or embedded devices, ensuring space efficiency and enabling
miniaturization.

(d) Some of commonly used serial communication protocols and their associated standards, along
with their applications and uses:

Universal Asynchronous Receiver-Transmitter (UART):


Application: UART is a simple serial communication protocol widely used for point-to-point
communication between devices. It is commonly used for serial communication between
microcontrollers, sensors, and peripheral devices in various applications.

Serial Peripheral Interface (SPI):


Application: SPI is a synchronous serial communication protocol used for communication
between microcontrollers and peripheral devices. It is commonly used for data exchange with
devices such as sensors, displays, memory chips, and other integrated circuits that require high-
speed data transfer.

Inter-Integrated Circuit (I2C):


Application: I2C is a multi-master, multi-slave serial communication protocol used for
communication between integrated circuits. It is commonly used for connecting low-speed
peripheral devices such as sensors, EEPROMs, real-time clocks, and I/O expanders to
microcontrollers.

Controller Area Network (CAN):


Application: CAN is a robust serial communication protocol designed for use in automotive and
industrial applications. It is commonly used for communication between microcontrollers,
sensors, actuators, and other devices in vehicles, industrial automation systems, and distributed
control systems.

RS-232 (Recommended Standard 232):


Application: RS-232 is a legacy serial communication standard used for point-to-point
communication between devices. It is commonly used for connecting computers to peripheral
devices such as modems, printers, and serial terminals. Though less common in modern
applications, RS-232 is still used in specific industries.
RS-422 (Recommended Standard 422):
Application: RS-422 is a standard for serial communication that defines the electrical and
functional characteristics of balanced voltage digital interface circuits. It is commonly used for
long-distance data transmission and provides robust communication in industrial and professional
applications.

RS-485 (Recommended Standard 485):


Application: RS-485 is a robust serial communication standard used for long-distance
communication and multi-drop configurations. It is commonly used in industrial automation,
building automation, and other applications that require reliable and noise-immune
communication over long distances.

[Q2]

(a) Software Tools:

1. Integrated Development Environment (IDE):


Application: IDEs provide a complete development environment for writing, compiling, and
debugging code for 8051 microcontrollers. They offer features like code editors, compilers,
debuggers, and simulators.

2. Compiler and Assembler:


Application: Compilers and assemblers convert high-level code (C, C++) or assembly code into
machine code that can be executed by the 8051 microcontrollers. They optimize code size and
performance and generate executable files for the target hardware.

3. Debugger:
Application: Debuggers help identify and fix software bugs by allowing engineers to step through
the code. They help in code optimization, memory debugging, and real-time debugging.

4. Simulators:
Application: Simulators allow engineers to test and simulate the behavior of the microcontroller
and its connected peripherals without the need for physical hardware. They help verify code
functionality, validate algorithms, and debug system behavior before deployment.

Hardware Tools:

1. 8051 Development Board:


Application: Development boards provide a hardware platform for prototyping and testing 8051-
based microcontroller systems. They typically include the microcontroller chip, support
components, interfaces (such as LEDs, switches, LCD displays), and connectivity options for
peripherals.

2. In-Circuit Emulator (ICE):


Application: ICE tools connect to the target microcontroller and provide advanced debugging
capabilities, including real-time execution control, memory access, and trace features. They
enable engineers to analyze and debug the system behavior in real-time on the actual hardware.
3. Programmers:
Application: Programmers are used to transfer the compiled firmware or code onto the 8051
microcontroller's memory. They facilitate the programming of the microcontroller, enabling
engineers to update or replace the firmware as needed.

(b)
Manufacture Proprietary names Costs
N87C52T2 $0.77
Advanced Micro Devices
D8751H $0.95

S87C581 $0.049
Intel
P87C541 $0.057

AT89C2051-24PU $2.18
Microchip Technology
AT89S8253-24PU $4.67

STM8S003F3P6TR $1.14
STMicroelectronics
STM32L031G6U6TR $3.18

C8051F860-C-GSR $2.92
Silicon Labs
C8051F850-C-GUR $3.14
(c)
8051 Arduino PIC FPGA ARM
Depending on
Specific
the specific Depending on
number of
Typically, model, Based on the the specific
I/O pins varies
from 4 to 128 ranging from specific ARM
Capabilities depending on
pins a few pins to FPGA model microcontrolle
the board
several r model
model
hundred pins
RAM (few
hundred bytes Memory
RAM (256 to a few capacity
Block RAM From a few
bytes to a few kilobytes) ranges from a
(BRAM) and kilobytes to
Memory kilobytes) ROM (few few hundred
Distributed several
ROM (2 to 64 kilobytes to bytes to
memory megabytes
kilobytes) several several
hundred kilobytes
kilobytes).
External
ADC/DAC
ADC/DAC Yes/Yes Yes/Rare Yes/Yes Yes/Yes
through I/O
pins
Serial UART, SPI,
UART, SPI, UART, SPI, UART, SPI,
Communicati UART, SPI I2C, CAN,
I2C I2C, CAN I2C, CAN
on Ethernet
Availability Widely Widely Widely Widely Widely
Relatively Relatively From low-cost
Cost Cost effective Low-cost
low-cost expensive to expensive
No fixed
Depends on ISA.
Harvard
the underlying [Hardware
architecture
microcontrolle description
ISA and uses an 8- RISC RISC
r used. (Atmel language
bit instruction
AVR or ARM (HDL),
set
Cortex-M) VHDL or
Verilog]
Forums &
Yes. (Arduino
Online Yes Yes Yes Yes
community)
support
Aerospace,
Defense, Consumer
Industrial Consumer Industrial electronics,
Home
automation, electronics, automation, Industrial
automation,
Home Automotive Image and automation,
Applications Robotics,
automation, systems, video Automotive
IoT,
Consumer Medical processing, systems,
Prototyping
electronics devices High- Medical
performance devices
computing,
signal
processing
General General-
purpose purpose
registers, No fixed registers,
128-byte
Depends on Special register Status
register bank
Register the specific function structures. registers,
divided into
Structure microcontrolle registers, User-defined Control
four register
r used Status and depend registers,
banks
registers, on the design Peripheral-
Control specific
registers registers
Implement
soft
processors,
8-bit such as
Depending on Depending on
microcontrolle microprocess Depend on the
the underlying the particular
r with a or or chosen ARM
CPU microcontrolle PIC
single-cycle microcontroll microcontrolle
r (8-bit, 16- microcontrolle
execution er within the r model
bit, 32-bit) r model
architecture FPGA fabric.
(ARM
Cortex-A9,
Cortex-M3)
Timers/Count
ers, UART,
Timers/Count Timers/Count SPI, I2C,
Timers/Count Timers/Count
ers, UART, er, UART, CAN, PWM,
ers, UART, ers, UART,
Peripheral SPI, I2C, SPI, Memory Ethernet,
SPI, I2C, SPI, I2C,
Subsystems PWM, interfaces, USB, DMA
PWM, CAN, PWM,
Interrupt Ethernet (Direct
Interrupts Interrupts
controllers controllers Memory
Access),
Interrupts

(d) Level of Abstraction:


Low-Level Language: Low-level language provides a close correspondence between the
instructions executed by the microcontroller and the machine code. It is a one-to-one
representation of the underlying hardware, and programmers work directly with registers,
memory addresses, and instructions.
High-Level Language: High-level languages provide a higher level of abstraction, allowing
programmers to write code in a more human-readable and structured manner. They abstract the
underlying hardware details, providing built-in functions and libraries for easier programming.
Visual C and Basic are examples of high-level languages commonly used for microcontroller
programming.
Readability and Ease of Use:
Low-Level Language: Low-Level language is often considered more difficult to read and write
compared to high-level languages. It requires a deep understanding of the microcontroller's
architecture and instruction set, making it less intuitive for beginners.
High-Level Language: High-level languages are designed to be more readable and user-friendly.
They use natural language constructs, syntax, and abstractions that are easier to understand and
maintain. This makes them more accessible to programmers, including those new to
microcontroller programming.

Development Speed:
Low-Level Language: Writing code in assembly language typically requires more effort and time
compared to high-level languages. Since assembly instructions are more complex, it takes longer
to write, debug, and maintain assembly code.
High-Level Language: High-level languages offer faster development cycles. They provide
higher-level abstractions, pre-built functions, and libraries that simplify and accelerate the coding
process.

Code Portability:
Low-Level Language: Low-Level code is tightly coupled to the microcontroller's specific
architecture and instruction set. Porting Low-Level code from one microcontroller to another
typically requires significant modifications to adapt to the new hardware.
High-Level Language: High-level languages are generally more portable. Code written in a high-
level language can be more easily drifted to different microcontrollers or platforms with minimal
changes. This enables code reuse and flexibility in selecting different microcontrollers based on
project requirements.

Access to Hardware Features:


Low-Level Language: Assembly language provides direct access to the microcontroller's
hardware features, registers, and peripherals. This level of control allows for fine-grained
manipulation and optimization of the hardware resources.
High-Level Language: High-level languages often abstract the hardware details, limiting direct
access to specific hardware features. However, they provide libraries, APIs, and frameworks that
expose high-level functions to interact with the microcontroller's peripherals and hardware
features.
[Q3]

(a) Sample ALP code is following,

ORG 0x0000

; Direct Addressing Mode

MOV A, 0x25

; Immediate Addressing Mode

MOV R1, #0x7F

; Register Addressing Mode

MOV R2, R3

; Register Indirect Addressing Mode

MOV A, @R2

; Indexed Addressing Mode

MOVX A, @DPTR

; Relative Addressing Mode

CJNE A, B, LABEL1

; Bit Addressing Mode

SETB P1.0

LABEL1:

NOP

END

• Direct Addressing Mode: The value at a specific memory location (0x25) is moved to the
accumulator (A).
• Immediate Addressing Mode: An immediate value (0x7F) is moved to register R1.
• Register Addressing Mode: The value from register R3 is moved to register R2.
• Register Indirect Addressing Mode: The value pointed by register R2 is moved to the
accumulator (A).
• Indexed Addressing Mode: The value pointed by DPTR (Data Pointer) is moved to the
accumulator (A).
• Relative Addressing Mode: A conditional jump is performed based on the comparison of A
and B, and a label (LABEL1) is used for branching.
• Bit Addressing Mode: Bit 0 of Port 1 is set to 1.
(b)

Increment PC and
Fetch Cycle Decode and Execute
Repeat

Fetch Cycle: In this stage, the microcontroller fetches the instruction from memory based on the
program counter (PC) value. The PC holds the address of the next instruction to be fetched. The
instruction is stored in the instruction register (IR).

Decode & Execute: The fetched instruction is decoded to determine the corresponding operation to
be performed. The microcontroller executes the instruction, which can involve reading or writing data
to registers or memory, performing arithmetic or logical operations, or controlling the flow of the
program.

Increment PC & Repeat: After executing the instruction, the program counter (PC) is incremented
to point to the next instruction in memory. The microcontroller then repeats the Fetch-Execution cycle
to fetch and execute the next instruction.

(c)
ROM:

ROM stands for Read-Only Memory. It is a non-volatile memory type that stores program
instructions and data that are permanently written during the manufacturing process and cannot be
modified by the user during runtime.

The 8051 microcontrollers typically have two types of ROM:

• Program ROM (PROM): This is where the microcontroller stores the program code or
firmware that controls its operation. The program code is usually written by the
manufacturer and is responsible for executing specific tasks and functions. PROM is non-
volatile, meaning the program code remains intact even when the power is turned off.
• Data ROM: This ROM is used to store fixed data, constants, lookup tables, and other data
that the program may require. It is also non-volatile and retains its contents even after
power is removed.

The ROM in the 8051 microcontroller is crucial for the execution of the program and the storage
of critical data. It provides a permanent and stable storage solution, ensuring that the program and
essential data are available every time the microcontroller is powered on.
During the development process, programmers typically write the desired program code using an
assembly language or high-level language and then burn it onto the ROM of the 8051
microcontrollers using a specific device programmer. Once the code is burned into the ROM, it
cannot be changed or modified without using external programming tools.

RAM:

RAM stands for Random Access Memory. It is a volatile memory type that is used for temporary
storage of data during program execution. RAM in the 8051 microcontrollers can be both internal
and external.

Internal RAM: The 8051 microcontroller has an internal RAM of 128 bytes (addressed from 0x00
to 0x7F). The internal RAM is divided into several areas, each serving specific purposes:

• Register Banks: The first 32 bytes (addressed from 0x00 to 0x1F) are used as register
banks. These banks are used for storing data and variables during program execution. The
register banks R0 to R7 are general-purpose registers that can be used for various
operations.
• Special Function Registers (SFRs): The next 32 bytes (addressed from 0x20 to 0x3F) are
allocated for SFRs. SFRs are memory-mapped registers that control various functionalities
of the microcontroller, such as I/O ports, timers, interrupt control, and serial
communication.
• Stack Area: The last 64 bytes (addressed from 0x80 to 0xFF) are used as the stack area.
The stack is a special area used for temporary storage of data during subroutine calls and
interrupt handling.

Internal RAM in the 8051 microcontroller is fast and allows for quick access to data during
program execution. However, its capacity is limited, and proper memory management is required
to ensure efficient utilization.
External RAM: The 8051 microcontrollers can also connect external RAM for additional data
storage. External RAM can be interfaced with the microcontroller through the address and data
buses. The maximum external RAM capacity that the 8051 microcontrollers can address depends
on the specific model and its address decoding capabilities.

External RAM provides the advantage of increased storage capacity, allowing for larger data sets
or more complex applications. It is commonly used when the internal RAM is insufficient for the
requirements of the program.

(e) ROM in the 8051 microcontroller is used for permanent storage of program code and read-only
data, while RAM provides temporary storage for variables and data during program execution.
ROM is non-volatile and read-only, while RAM is volatile and allows read and write operations.
ROM is typically smaller in capacity compared to RAM, which can be expanded using external
memory.

ALP code to access ROM:

ORG 0x0000 ;

MOV A, #0x02 ; Load the address of the ROM location into the accumulator
MOV DPTR, #0x4000 ; Set the data pointer to point to the ROM area (address 0x4000)

MOVX A, @DPTR ; Read the data from the ROM location pointed by DPTR into the
accumulator

END

ALP code to access RAM:

ORG 0x0000

MOV A, #0x0A ; Load a value into the accumulator

MOV R0, #0x10 ; Load the address of the RAM location into register R0
MOV @R0, A ; Write the value from the accumulator into the RAM location pointed by
R0

MOV A, @R0 ; Read the value from the RAM location pointed by R0 into the
accumulator

END
(f) Lookup tables are data structures commonly used in programming to store pre-calculated values.
They provide a way to retrieve values quickly and efficiently by using an index or key. The
concept of lookup tables is particularly useful when repetitive calculations or complex data
manipulations can be simplified by replacing them with table lookups.

ALP example;

ORG 0x0000

MOV R0, #5 ; Assume we want to calculate the square of 5

; Lookup table for squares from 0 to 9


SQUARE_TABLE:
DB 0, 1, 4, 9, 16, 25, 36, 49, 64, 81

MOV A, R0 ; Move the number to be squared to the accumulator


ADD A, A ; Multiply the number by 2 to use it as an index

MOV DPTR, #SQUARE_TABLE ; Load the lookup table address to DPTR


MOVX A, @DPTR ; Access the lookup table using the index (multiplied number)
MOV B, A ; Move the square value to register B

END

In this example, we have a lookup table named ‘SQUARE_TABLE’ that stores the pre-calculated
squares from 0 to 9. Each entry in the table represents the square of the corresponding index.

To use the lookup table, we assume that we want to calculate the square of the number 5. We load
the number into register R0. Then, we multiply the number by 2 to use it as an index for the
lookup table.

Next, we load the address of the lookup table (SQUARE_TABLE) to the data pointer (DPTR).
Using the indexed addressing mode (MOVX instruction), we access the value at the lookup table
corresponding to the index (multiplied number) and store it in the accumulator (A). Finally, we
move the square value from the accumulator to register B for further use.
(g)
Hardware Polling Software Polling

• In hardware polling, the


microcontroller continuously checks • In software polling, the microcontroller
the status of a hardware input or output relies on software loops or timers to
device to determine if it requires periodically check the status of a device
attention. or event.
• The microcontroller dedicates a portion • The microcontroller sets up a timer or
of its code to regularly poll the device's delay, and during each iteration, it
status by reading relevant registers or checks the status of the device or event.
pins. • It allows the microcontroller to perform
• It requires the microcontroller to other tasks while waiting for the device
actively check the status, which may or event, making it more efficient.
consume processing power and result • It is suitable for situations where the
in slower response times. device's status changes frequently or
• It is suitable for situations where the where the microcontroller needs to
device's status changes infrequently or perform other tasks while waiting.
where immediate response is not
critical.

Interrupts Polling

• Interrupts are hardware or • Polling involves actively


software signals that indicate the checking the status of a device or
occurrence of an event or event at regular intervals to
condition that requires determine if it requires attention.
immediate attention. • The microcontroller
• When an interrupt occurs, the continuously polls the device or
microcontroller suspends its event using hardware or software
current execution and transfers techniques.
control to an interrupt service • Polling is a synchronous
routine (ISR) to handle the event. mechanism and requires the
• Interrupts provide a way to microcontroller to allocate
handle events asynchronously processing time to check the
and can prioritize certain events device's status.
over others.
[Q4]

(a) Timers:
Timers are essential components of microprocessors and microcontroller systems, enabling
precise timing, synchronization, and control of events. They provide the foundation for time-
based operations, real-time applications, and critical timing requirements in a wide range of
electronic devices and embedded systems.

Counters:
Counters, along with timers, are fundamental blocks in microprocessor systems, enabling precise
event counting, time measurement, signal control, and sequencing. They enhance the capabilities
of microprocessors and microcontrollers, enabling them to perform a wide range of tasks with
accurate timing, synchronization, and control.

(b) The Watchdog Timer (WDT) is a hardware component found in many microcontrollers that
serves as a safety mechanism to prevent system lock-ups or malfunctions. It acts as a timer that
needs to be periodically reset by the software, and if the software fails to reset it within a specified
time frame, the WDT triggers a system reset or takes a predefined corrective action.

The Watchdog Timer is mostly useful in applications where system reliability is critical, such as
industrial control systems, safety-critical devices, and embedded systems operating in harsh
environments. It helps maintain system stability, enhances fault tolerance, and provides an
additional layer of protection against software glitches or failures.

(c)
(i) Last 5 digits of my registration number = 13310
Hence, Delay time = 13310us
Calculations for the delay;
1us * [((2 * 255) + (2 * 1)) * delay + 2] = 13310us
Delay = 24.99 ~ 2510
2510 = 1916

ALP code:

ORG 0H
MOV R0, #19H
HERE: MOV R1, #0FFH
AGAIN: DJNZ R1, AGAIN
DJNZ R0, HERE
END
.lst file:

Using_software_delay PAGE 1

1 ORG 0H

0000 7819 2 MOV R0, #19H

0002 79FF 3 HERE: MOV R1, #0FFH

0004 D9FE 4 AGAIN: DJNZ R1, AGAIN

0006 D8FA 5 DJNZ R0, HERE

6 END

ASSEMBLY COMPLETE, NO ERRORS FOUND, NO WARNINGS

(ii) Last 5 digits of my registration number = 13310


Hence, Delay time = 13310us
Calculations for the delay;
Count in register = Max. count – Desired count + 1
= FFFF16 – 1331010 + 1
= 6553510 – 1331010 + 1
= 5222410 = CC0016
ALP code:

ORG 0H
DELAY: MOV TMOD, #01H
MOV TH0, #0CCH
MOV TL0, #000H
SETB TR0
WAIT: JNB TF0, WAIT
CLR TR0
CLR TF0
END

.lst file:

Using_8051_timer PAGE 1
1 ORG 0H
0000 758901 2 DELAY: MOV TMOD, #01H
0003 758CCC 3 MOV TH0, #0CCH
0006 758A00 4 MOV TL0, #000H
0009 D28C 5 SETB TR0
000B 308DFD 6 WAIT: JNB TF0, WAIT
000E C28C 7 CLR TR0
0010 C28D 8 CLR TF0
9 END
ASSEMBLY COMPLETE, NO ERRORS FOUND, NO WARNINGS
[Q5] Puzzle Parking Systems (PPS) are innovative and efficient parking solutions designed to
maximize the utilization of limited parking space. These systems are particularly useful in urban areas
or locations with limited land availability, where parking space is a premium.

The concept behind Puzzle Parking Systems is to stack multiple vehicles vertically and horizontally,
utilizing a mechanical or automated system to move and position the vehicles. This allows for more
efficient utilization of available space by minimizing the area required for maneuvering and parking.

Here are some key features and benefits of Puzzle Parking Systems:

• Space Optimization: Puzzle Parking Systems can park a large number of vehicles in a
compact footprint. By stacking vehicles vertically and horizontally, these systems can
significantly increase parking capacity, enabling more cars to be parked in a limited area.
• Efficient Parking and Retrieval: These systems ca work on automated or semi-automated
mechanisms to move and position vehicles, making parking and moving faster and more
convenient. Users can park or move their vehicles with minimal effort and in a shorter amount
of time.
• Customizable Designs: Puzzle Parking Systems come in various configurations and designs
to suit different parking requirements and available space. They can be customized to park
different vehicle sizes, weight capacities, and parking layouts.
• Reduced Environmental Impact: By maximizing parking capacity in a smaller area, Puzzle
Parking Systems contribute to a reduction in the environmental footprint associated with
traditional parking structures. They help minimize land use, reduce construction materials,
and improve overall energy efficiency.

While Puzzle Parking Systems offer numerous advantages, it's important to consider some factors
such as maintenance requirements, user convenience, and the need for proper training and operational
guidelines. Regular maintenance and monitoring are essential to ensure the reliable and safe operation
of these systems.

Unlike parking lifts, there is no need to have support staff who can remove vehicles on the ground
level and lower the raised platforms. Users can instead directly identify themselves and call their cars.
From there, the system will move around its platforms to bring that person’s car to grade level, where
they can then drive it out of its parking spot. Puzzle parking systems are highly convenient thanks to
this streamlined operational setup.

In summary, Puzzle Parking Systems provide an efficient and space-saving solution for maximizing
parking capacity. They offer improved space utilization, convenience, and security, making them a
viable option for urban areas and locations where parking space is limited.

You might also like