Professional Documents
Culture Documents
(i) Internal bus width: The internal bus width refers to the number of data lines or bits used
for communication within the microcontroller's internal architecture. It determines the
maximum amount of data that can be transferred between different components of the
microcontroller, such as the CPU, memory, and peripherals, in a single operation. A wider
internal bus allows for the simultaneous transfer of more data, resulting in improved
performance and faster data processing.
(ii) Speed: The speed of a microcontroller refers to how quickly it can execute instructions
and perform operations. It is typically measured in terms of clock frequency, which
represents the number of cycles per second that the microcontroller's central processing
unit (CPU) can execute. Higher clock frequencies generally indicate faster processing speeds
and the ability to execute more instructions within a given time period. However, it's
important to note that the speed of a microcontroller is not solely determined by its clock
frequency but also by other factors such as the efficiency of its architecture and instruction
set.
(iii) External memory: Microcontrollers have limited on-chip memory resources for storing
program instructions and data. External memory refers to additional memory devices that
can be connected to the microcontroller to expand its available storage capacity. This
external memory can be in the form of RAM (Random Access Memory) or ROM (Read-Only
Memory) and is typically used to store larger amounts of data or program code that cannot
fit within the microcontroller's internal memory. The microcontroller communicates with
external memory through specific interfaces, such as memory buses or protocols like SPI
(Serial Peripheral Interface) or I2C (Inter-Integrated Circuit). External memory provides
flexibility in designing applications that require larger storage capacities or non-volatile
memory for program code or data storage.
2. (a) State:
(b) An analogue signal is passed through ADC then processed through a microcontroller and
converted back to analogue before it is displayed on a CRO. Draw a schematic diagram of the
system.
TABLE 1
MOV R7, # 24 H
MOV A, 00H
ADD A; R5
ADD A; R7
ADD A;
ADD A;
end
1. Step 1: The value 30H (48 decimal) is loaded into Register R5.
2. Step 2: The value 24H (36 decimal) is loaded into Register R7.
3. (a) State:
1. Mechanical Actuation: In this method, the limit switch is actuated by physical contact with
an object or a moving part. When the object or part comes into contact with the switch's
actuator, it mechanically triggers the switch, causing it to change its state.
2. Magnetic Actuation: Magnetic actuation involves the use of a magnetic field to actuate
the limit switch. The switch contains a magnetically sensitive component, such as a reed
switch, that is triggered when a magnetic field of sufficient strength is applied. The presence
or absence of the magnetic field determines the state of the limit switch.
3. Proximity Actuation: Proximity actuation relies on the principle of detecting the presence
or proximity of an object without physical contact. These limit switches use technologies
such as inductive, capacitive, or optical sensing to detect the object's presence or absence.
When the object is within the sensing range, the limit switch is actuated.
(b) Explain THREE differences between reduced instruction set (RISC) and complex
instruction set (CIS).
- RISC: RISC architectures have a simplified and streamlined instruction set. Instructions are
designed to be simple, with a fixed length and a limited number of addressing modes.
- CISC: CISC architectures have a complex and rich instruction set that includes instructions
with variable lengths and numerous addressing modes. CISC architectures aim to provide
powerful and versatile instructions to handle complex tasks.
2. Instruction Execution:
- RISC: RISC architectures typically execute instructions in one clock cycle. Instructions are
designed to perform simple operations efficiently.
- CISC: CISC architectures may require multiple clock cycles to execute certain instructions
due to their complexity. Instructions can perform more complex operations directly,
reducing the need for multiple instructions.
3. Memory Access:
- RISC: RISC architectures rely heavily on register-based operations. Most RISC instructions
operate on data stored in registers, reducing the need for frequent memory access.
- CISC: CISC architectures often include instructions that directly access memory, allowing
operations on data stored in memory without first loading it into registers. This flexibility can
simplify programming but may result in increased memory access.
(It's important to note that the distinction between RISC and CISC architectures has
become less pronounced over time, with modern processors often incorporating features
from both approaches. The evolution of processor design has led to a convergence where
the boundaries between RISC and CISC architectures have blurred.)
(c) A conveyor is controlled by a PLC using three switches. Switch 1 controls the motor,
switch 2 presence or absence of the load, and switch 3 indicates presence or absence of an
object along the operation area. For proper operation, the conveyor motor should be ON,
load present and no obstruction.
PLC (Programmable Logic Controller) designs can be categorized into different types based
on various criteria. Here are some common types of PLC designs:
A Unitary PLC contains all the features of a basic system in one compact unit,
the features include; A power supply. The main module which contains a
central processing unit (CPU). The input module. The output module. Unitary
PLC’s are fitted directly to the component or machine that they are controlling.
Compact PLC:
Compact PLCs are small-sized controllers designed for simple applications that require a
limited number of I/O (Input/Output) points. They are compact in size and often have fixed
configurations, meaning the number of I/O points and other features cannot be expanded or
modified.
Modular PLC:
Modular PLCs consist of separate modules that can be easily interconnected to form a
customized control system. These modules include the CPU module, power supply module,
I/O modules, communication modules, and more. The modular design allows flexibility in
terms of adding or removing modules to meet the specific requirements of the application.
Rack-mounted PLC:
Rack-mounted PLCs are designed to be installed in standard equipment racks. They are
typically used in larger control systems where multiple PLCs are required to control various
sections or processes. The PLC modules are mounted in rack slots, allowing for easy
expansion and replacement.
Distributed PLC:
Distributed PLCs are used in systems where the control functions are distributed across
multiple PLCs. These PLCs are connected through a communication network, enabling them
to share information and coordinate their operations. Distributed PLC designs are often
employed in large-scale industrial automation systems.
Safety PLC:
Safety PLCs are specifically designed to handle critical safety functions in industrial
applications. They are equipped with additional hardware and software features to meet
safety standards and regulations. Safety PLCs provide high levels of reliability, fault
tolerance, and advanced safety functions to ensure the safe operation of machinery and
protect personnel.
High-Performance PLC:
High-performance PLCs are designed for applications that require fast processing speeds
and complex control algorithms. These PLCs typically have powerful processors, high-speed
communication capabilities, and advanced programming features to handle demanding
control tasks and real-time applications.
Soft PLC:
Soft PLCs, also known as software PLCs, are PLC systems implemented on general-purpose
computers or embedded systems. They use specialized software to emulate the functionality
of traditional hardware-based PLCs. Soft PLCs offer flexibility, scalability, and cost-
effectiveness, making them suitable for various industrial automation applications.
(b) In an aeroplane dashboard, a RED warning light comes ON when the ignition (1) is
switched ON and the Door (D) is not closed properly, OR the seat belt (S) is not fastened. The
system is under PLC control.
(c) With the aid of ONE line instruction, describe the following microcontroller instructions:
(i) Single-operand operations:
This instruction adds the contents of registers R2 and R3 and stores the result in register
R1.
It's important to note that the specific instruction formats and mnemonics can vary
depending on the microcontroller architecture and assembly language being used. The
examples provided above are general representations and may not be applicable to all
microcontrollers.
1. Central Processing Unit (CPU): The microcontroller includes a CPU core responsible for
executing instructions and performing data processing tasks. It may have a reduced
instruction set computer (RISC) or complex instruction set computer (CISC) architecture,
with a specified clock speed.
3. Input/Output (I/O) Ports: Microcontrollers feature multiple I/O ports for interfacing with
external devices. These ports can be configured as input or output to connect to sensors,
actuators, displays, communication interfaces (such as UART, SPI, I2C), and other
peripherals.
4. Timers/Counters: Timers and counters are essential features in microcontrollers used for
measuring time intervals, generating precise delays, and counting external events. They
facilitate tasks like PWM generation, scheduling, and synchronization of operations.
10. Development Tools and Support: Microcontrollers are typically supported by a range of
development tools, such as Integrated Development Environments (IDEs), compilers,
debuggers, and programming languages. These tools aid in programming, simulation,
testing, and debugging of microcontroller-based applications.
60KB
FFFF H
1. I/O Control: SFRs are often used for configuring and controlling the input/output (I/O)
ports of the microcontroller. They can be used to set the direction (input/output) of
individual pins, enable/disable internal pull-up resistors, configure interrupt settings, and
monitor the status of input signals.
2. Timer and Counter Control: Microcontrollers usually have built-in timers and counters for
performing time-related functions and generating precise time intervals. SFRs are used to
configure and control these timers and counters, including setting the timer mode, defining
the time base, enabling interrupts, and reading or writing the timer values.
3. Interrupt Control: Interrupts play a crucial role in microcontrollers, allowing the device to
respond promptly to external events or internal conditions. SFRs are used to enable or
disable interrupts, set the interrupt priority levels, and handle interrupt flags. They provide
the necessary control and configuration for efficient interrupt handling.
TABLE 2
MOV A, 78 H
ADD A, # 34 H
DAA
ADD CA, # 12 H
DAA
MOV R3, A
RET
1. MOV A, 78H: This instruction moves the value 78H into the accumulator (A).
2. ADD A, #34H: The program adds the immediate value 34H to the contents of the
accumulator (A).
3. DAA: DAA stands for Decimal Adjust Accumulator. It adjusts the value in the accumulator
after addition, ensuring that the result is in the correct decimal representation.
4. ADDC A, #12H: This instruction adds the immediate value 12H to the accumulator (A) with
carry (CY) enabled.
5. DAA: Similar to step 3, the DAA instruction adjusts the value in the accumulator after the
addition with carry.
6. MOV R3, A: This instruction moves the contents of the accumulator (A) into register R3.
7. RET: This instruction returns from the subroutine and continues program execution from
the point where the subroutine was called.
Overall, the program performs two additions, adjusts the result with the DAA instruction, and
stores the final result in register R3 before returning from the subroutine.
(ii) Hand coding the program into 8051 hexadecimal machine code:
To hand code the program into 8051 hexadecimal machine code, each instruction needs to
be converted into its corresponding hexadecimal opcode. Here's the hand-coded version of
the program:
Note: The opcodes mentioned above are specific to the Intel 8051 microcontroller. The
machine code representation can vary for different microcontrollers. It's crucial to refer to
the microcontroller's datasheet or programming manual for the accurate opcode values.
2. Timer Interrupts: Timer interrupts occur when a specific time interval or count is reached
by the internal timers of the microcontroller. They are commonly used for tasks that require
precise timing, such as generating PWM signals, measuring time intervals, or implementing
periodic tasks.
3. Serial Communication Interrupts: Serial communication interrupts are triggered when
data is received or transmitted through the microcontroller's serial communication
interfaces, such as UART, SPI, or I2C. These interrupts allow the microcontroller to handle
data communication in an event-driven manner, ensuring timely and efficient data
exchange.
(i) Data acquisition: Data acquisition refers to the process of collecting and gathering data
from various sources within a SCADA system. It involves monitoring and capturing
information from sensors, devices, and other data points. The data acquisition system in
SCADA is responsible for sampling, converting analog signals to digital (ADC), and storing the
data for further analysis and control.
(ii) Logging: Logging in SCADA systems involves recording and storing operational data and
events for future reference, analysis, and auditing purposes. It includes capturing data
related to process variables, alarms, events, and system activities. The logged data provides
a historical record that can be used for troubleshooting, performance analysis, compliance
reporting, and decision-making.
(i) Linearity: Linearity refers to the ability of an ADC (Analog-to-Digital Converter) or DAC
(Digital-to-Analog Converter) to provide an output that is proportional and accurately
represents the input signal over a specified range. Linearity is typically measured as a
percentage of the maximum deviation from a straight line when plotting the input versus
output relationship. A higher linearity value indicates better accuracy and faithful
representation of the input signal.
(II) Speed: Speed, in the context of ADC or DAC, refers to the conversion rate or the time
taken to complete a conversion of analog-to-digital or digital-to-analog signals, respectively.
It represents how quickly the converter can process and convert the input signal. Speed is
usually measured in terms of samples per second (SPS) or conversions per second (CPS) and
is an important consideration in applications that require real-time or high-speed data
acquisition or signal generation. Higher speed values indicate faster conversion rates.
ii) With the aid of schematic-block diagram, describe the operation of a counter-based
analogue to digital converter (ADC).
(b) (i) Differentiate between MOD 1 and MOD 2 of the 8051 microcontroller timer
operations.
MOD 1:
- The Timer 1 register (TH1 and TL1) is configured as a 16-bit register, allowing a wider range
of count values.
- The Timer 1 can be used for generating longer timing intervals compared to other modes.
- Timer 1 can be set to operate in either timer or counter mode, depending on the specific
application requirements.
- It provides more flexibility and accuracy in timing applications that require longer time
intervals or precise counting.
MOD 2:
- Timer 1 automatically reloads the initial value upon reaching its maximum count value
(255) and continues counting.
- MOD 2 mode is commonly used for generating fixed time delays or generating a constant
frequency signal using Timer 1 in timer mode.
Overall, MOD 1 mode offers a wider count range and more flexibility for longer timing
intervals, while MOD 2 mode provides simplicity and convenience for generating fixed time
delays or constant frequency signals.
ii) Table 3 shows a program listing a microcontroller. Given that the clock frequency is 12
MHz, determine the total delay time.. Assume one execution clock cycle = of crystal
frequency. 12
TABLE 3
MOV A, # 10
MOV RO, # 05 H
MOV R1, # 05 H
Loop: ADD A, A
DEC RO
JNZ LOOP
MOV @RI, A
RET
(b) (i) Differentiation between MOD 1 and MOD 2 of the 8051 microcontroller timer
operations:
Given that the clock frequency is 12 MHz, and assuming one execution clock cycle equals the
crystal frequency, we can calculate the total delay time using the provided program. Here's
the calculation:
Since one clock cycle is equal to the crystal frequency (12 MHz), the total delay time can be
calculated by dividing the total clock cycles by the crystal frequency:
= 11 / 12 MHz
= 0.92 μs
1. Hardwired Control Unit: In a hardwired control unit, the control signals and sequencing
logic are implemented using dedicated hardware circuits. The control unit is designed and
built with specific gates, flip-flops, decoders, multiplexers, and other digital components to
generate the necessary control signals for the microcontroller's operations. It provides fast
and deterministic control signal generation, as the control logic is directly implemented in
hardware. However, making changes or modifications to the control unit's functionality can
be challenging and require hardware redesign.
instructions based on the current instruction being executed and generates the
corresponding control signals. Microprogrammed control units offer flexibility and ease of
modification, as the control behavior can be modified by updating the microcode
instructions. However, it may introduce some overhead due to the additional microcode
fetch and execution steps.
Both hardwired and microprogrammed control units have their advantages and trade-offs,
and the choice depends on factors such as performance requirements, flexibility, ease of
modification, and the complexity of the microcontroller design.