0% found this document useful (0 votes)
21 views12 pages

CAT-1-A2-Answer Key

Uploaded by

aryanworks010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views12 pages

CAT-1-A2-Answer Key

Uploaded by

aryanworks010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Features of ARM

• ARM is a RISC processor.


• ARM stands for Advanced RISC Machine. It is one of the most licensed and
extensive processor cores in the world.
• It is used for small size and high performance applications.
• Simple architecture – low power consumption.
• ARM is a RISC processor.
• ARM stands for Advanced RISC Machine. It is one of the most licensed and
extensive processor cores in the world.
• It is used for small size and high performance applications.
• Simple architecture – low power consumption.
• In this designed processor there are only 25 basic instruction types.
• Through registers most of operations are implemented.
• Here every instruction has its own conditions with registers.
• This processor offers multiple modes of addressing.
• Manual stack manipulation is done here.
• Stack addressing and subroutines consist of explicitly programmed techniques.
• Because of 32 bits microprocessor, it is possible to have access to memory and data
manipulation saved in these 32 bits.
• The address range of this processor is widely 26 bit.
• For direct access it allows 64 megabytes of memory.
• It consists of single cycle execution method.

• Arithmetic Logic Unit


all logical operations
• MAC
Multilply and accumulate
Barrel shifter
This field indicates the kind of shift to be performed (logical left or
right, arithmetic right or rotate right). The quantity by which the register ought to be
shifted is contained in an immediate field within the instruction or it might be the
lower 6 bits of a register within the register file.
Control Unit
• For any microprocessor, control unit is the heart of the whole process and it is
responsible for the system operation, so the control unit design is the most important
part within the whole design.
• The control unit is sometimes a pure combinational circuit design. Here, the control
unit is implemented by easy state machine.
• The processor timing is additionally included within the control unit.
• Signals from the control unit are connected to each component within the processor to
supervise its operation.
ARM single-cycle instruction 3- stage pipeline operation

3-Stage Pipeline
• At any time slice, 3 different instructions may occupy each of these stages, so the
hardware in each stage has to be capable of independent operations
• When the processor is executing data processing instructions , the latency = 3 cycles
and the throughput = 1 instruction/cycle
ARM Registers Organization
• 37 registers
• 31 general 32 bit registers, including PC
• 6 status registers
• In user mode - 15 general registers (R0 to R12),
counter are visible at any time –when you write user-level programs
• R13 (SP- stack pointer) - individual stack for each processor mode
• R14 (LR – Linked Register) – holds the return address of the subroutine to
continue main program
• R15 (PC – Program Counter) – fetch next instruction for execution
• The visible registers depend on the processor mode
• The other registers (the banked registers) are switched in to support IRQ, FIQ,
Supervisor, Abort and Undefined mode processing
**************************************************************************

 Model design controller is designed to control the speed of the train when coming on
track.
 Simple trains either run at a constant speed or use a simple speed control.
 Modern model trains can make use of digital train controllers that send messages
along the tracks to the train engine.
 It is a one way communication system.
 The user sends messages to the train with a control box attached to the tracks. The
control box may have controls such as a throttle (a device controlling the flow of
fuel or power to an engine), emergency stop button, and so on.
 Train receives its electrical power from the two rails (steel bar or continuous line of
bars laid on the ground) of the track and the control box can send signals to the
train over the tracks by modulating the power supply voltage.
• The control box sends packets over the tracks to the receiver on the train.
• The train includes analog electronics to receive bits and a control system to set the
train motor’s speed and direction based on those commands
• Each packet includes an address, so that the console can control several trains on the
same track;
• The packet also includes an Error Correction Code (ECC), to guard against
transmission errors.
• Header: It displays information such as the IP version, the packet’s length, the
source, and the destination.
• Throttle: regulating the supply of a fluid (as steam) to an engine. It is a mechanical
device used to control speed of engine.
• Inertia means an object will continue its current motion until some force causes its
speed or direction to change.

Requirement:
• Console can control 8 trains on single track.
• The speed of each train shall be controllable by a throttle to at least 63 different levels
in each direction (forward and reverse).
• Inertia control that allow the user to adjusts responsiveness of the train to commanded
changes in speed with at least 8 levels.
• Emergency stop button.
• An Error Detection scheme will be used to transmit messages.

The DCC standard is given in two documents:


• Standard S-9.1, DCC Electrical Standard.
 It defines how bits are encoded on the rails for transmission
• Standard S-9.2, DCC Communication Standard
 It defines the packets that carry information
DCC Electrical Standard
• The Electrical Standard deals with voltages and currents on the track.
• Bits are encoded in the time between transitions, not by voltage levels.
• 0 is at least 100 µs while a 1 is nominally 58 µs.

DCC Communication Standard


• Basic packet format: PSA(sD)+E
• P: preamble = 1111111111.
• S: packet start bit = 0.
• A: Address data byte, An address is eight bits long. The addresses 00000000,
11111110, and 11111111 are reserved.
• s: data byte start bit = 0.
• D: data byte (data payload),which includes eight bits. A data byte may contain an
address, instruction, data, or error correction information.
• E: packet End bit = 1.
Specification
• Conceptual Specification
We will use the experience gained by writing the conceptual specification to help us
write a detailed specification to be given to a system architect.
A train control system turns commands into packets. A command comes from the
command unit while a packet is transmitted over the rails.

Console system classes


 The console needs to perform three functions: read the state of the front panel on
the command unit, format messages, and transmit messages.
 The train receiver must also perform three major functions: receive the message,
interpret the message (taking into account the current speed, inertia setting, etc.),
and actually control the motor
 Panel: It contains the analog knobs and hardware to interface to the digital parts of
the system.
 Formatter: It includes behaviors that know how to read the panel knobs and creates a
bit stream for the required message.
 Transmitter: interfaces to analog electronics to send the message along the track.
 Knobs*: It describes the actual analog knobs, buttons, and levers on the control panel.
 Sender*: It describes the analog electronics that send bits along the track.

 Receiver: It knows how to turn the analog signals on the track into digital form.
 Controller: It interpret the commands and figures out how to control the motor.
 Motor interface: It defines how to generate the analog signals required to control the
motor.
 Detector*: It detects analog signals on the track and converts them into digital form.
 Pulser*: It turns digital commands into the analog signals required to control the
motor speed.
**************************************************************************
• Serial data communication uses two methods
– Synchronous method transfers a block of data at a time
– Asynchronous method transfers a single byte at a time
• There are special IC’s made by many manufacturers for serial communications.
– UART (universal asynchronous Receiver transmitter)
– USART (universal synchronous-asynchronous Receiver-transmitter)
Asynchronous – Start & Stop Bit
• Asynchronous serial data communication is widely used for character-oriented
transmissions
– Each character is placed in between start and stop bits, this is called
framing.
– Block-oriented data transfers use the synchronous method.
• The start bit is always one bit, but the stop bit can be one or two bits
• The start bit is always a 0 (low) and the stop bit(s) is 1 (high)

Registers related to Serial Communication


1. SBUF Register
2. SCON Register
3. PCON Register

SBUF Register
• SBUF is an 8-bit register used solely for serial communication.
• For a byte data to be transferred via the TxD line, it must be placed in the SBUF
register.
• The moment a byte is written into SBUF, it is framed with the start and stop bits and
transferred serially via the TxD line.
• SBUF holds the byte of data when it is received by 8051 RxD line.
• When the bits are received serially via RxD, the 8051 deframes it by eliminating the
stop and start bits, making a byte out of the data received, and then placing it in
SBUF.
#include <reg51.h> /* Include x51 header file */
void UART_Init()
{
TMOD = 0x20; /* Timer 1, 8-bit auto reload mode */
TH1 = 0xFD; /* Load value for 9600 baud rate */
SCON = 0x50; /* Mode 1, reception enable */
TR1 = 1; /* Start timer 1 */
}
void Transmit_data(char tx_data)
{
SBUF = tx_data; /* Load char in SBUF register */
while (TI==0); /* Wait until stop bit transmit */
TI = 0; /* Clear TI flag */
}
void String(char *str)
{
int i;
for(i=0;str[i]!=0;i++) /* Send each char of string till the NULL */
{
Transmit_data(str[i]); /* Call transmit data function */
}
}
void main()
{
UART_Init(); /* UART initialize function */
String("test"); /* Transmit 'test' */
while(1);
}
***************************************************************************
4. With necessary circuit diagram explain the DAC and illustrate the characteristics of
the same
• The Microcontroller output is binary values, but application equipments display,
motor, speakers etc. work in analog signal. So we need digital to Analog converters.
• 8 bit current output monolithic DAC
• Manufactured by national semiconductor corporation
• 16 pin IC available
• 8 input lines (digital input)
• Single output

• In DAC 0808 the digital inputs are converted to current ( Iout). The current Iout is
converted into voltage using Op- amp The Current value in Iout pin is depends upon
the binary numbers at the Do – D7 inputs of the DAC 0808 and the reference current (
I ref )

R-2R DAC
• R-2R Digital-to-Analogue Converter, or DAC, is a data converter which use two
precision resistor to convert a digital binary number into an analogue output signal
proportional to the value of the digital number

• Recall that the bits of a binary number can have only one of the two values. i.e., either
0 or 1. Let the 3-bit binary input is b2b1b0.
• Here, the bits b2 denote the Most Significant Bit (MSB) and b0 denote Least
Significant Bit (LSB) respectively.
• The digital switches shown in the figure will be connected to ground, when the
corresponding input bits are equal to ‘0’. Similarly, the digital switches shown in
figure will be connected to the negative reference voltage, −VR when the
corresponding input bits are equal to ‘1’.
• It is difficult to get the generalized output voltage equation of a R-2R Ladder DAC.
But, we can find the analog output voltage values of R-2R Ladder DAC for individual
binary input combinations easily.
Advantages of a R-2R Ladder DAC
• R-2R Ladder DAC contains only two values of resistor: R and 2R. So, it is easy to
select and design more accurate resistors.
• If more number of bits are present in the digital input, then we have to include
required number of R-2R sections additionally.

Characteristics of DAC
 Resolution
 Accuracy
 Conversion Time
 Settling Time
 Vfs
 Output Voltage
**************************************************************************
5. Explain how DC motor is interfaced with 8051 for different duty cycle

Small DC Motor
DC motor converts electrical energy in the form of Direct Current into mechanical energy.
• In the case of the motor, the mechanical energy produced is in the form of a rotational
movement of the motor shaft.
• The direction of rotation of the shaft of the motor can be reversed by reversing the
direction of Direct Current through the motor.
• The motor can be rotated at a certain speed by applying a fixed voltage to it. If the
voltage varies, the speed of the motor varies.
• Thus, the DC motor speed can be controlled by applying varying DC voltage; whereas
the direction of rotation of the motor can be changed by reversing the direction of
current through it.
• For applying varying voltage, we can make use of the PWM technique.
• For reversing the current, we can make use of an H-Bridge circuit or motor driver ICs
that employ the H-Bridge technique or any other mechanisms.

• DC Motor rotates continuously at constant speed of DC Motor depends upon the


average DC Voltage applied across its armature.
• If we want to change the speed of the motor to vary the applied DC Voltage, If the
polarity of the applied voltage is changed, the motor can run in reverse direction.
• In modern days, the speed of the DC Motor is Controlled by using Pulse width
modulation( PWM) method.
• By using the PWM signal, the average voltage of the DC motor can be varied, there
by the speed of the DC motor is controlled.
• Two different pulse modulated signals are shown in the fig 5.25. In the second
waveform, ON period is high and OFF period is low. Therefore its average voltage is
high.
• In the first waveform ON period is low and the OFF period is high. Therefore its
average voltage is low. In pulse width modulation, the period of the pulse is kept
constant. Pulse ON period and OFF period times may be varied.

• The speed of the DC motor is increased, when the duty cycle of the signal is high.
• Similarly, the speed of the DC motor is decreased, when the duty cycle of the signal is
low.
• By using the program, we can be able to change the duty cycle of the PWM signal and
also the motor speed may be varied.
• Normally the current produced from the microcontroller is not sufficient to drive the
DC motor effectively. Hence drivers may be connected in between the motor and
microcontroller.
• In some applications, we keep the speed of the motor as constant. For doing this, a
feedback circuit may be connected to it.
• The feedback circuit contains a speed sensor for getting the present speed of the
motor.
• According to the sensor output, the microcontroller adjusts the speed of the motor by
changing the duty cycle of the signal applied to it. Hence constant speed can be
maintained.

Let’s interface the DC motor with the AT89S52 microcontroller and control the DC motor
speed by using the Speed Increment Switch and Speed Decrement Switch connected to the
Microcontroller port and direction by using Direction Switch.
We are going to use the L293D motor driver IC to control the DC motor movement in both
directions. It has an in-built H-bridge motor drive.
• As shown in the above figure we have connected two toggle switches on the P1.0 and
P1.1 pin of the AT89S52 microcontroller to change the speed of the DC motor by
10%.
• One toggle switch at pin P1.2 controls the motor's rotating direction.
• P1.6 and P1.7 pins are used as output direction control pins. It provides control to
motor1 input pins of the L293D motor driver which rotate the motor clockwise and
anticlockwise by changing their terminal polarity.
• Speed of the DC Motor is varied through PWM Out pin P2.0.
• the timer of AT89S52 is used to to generate PWM.
**************************************************************************

You might also like