Question: #include / / Include register definitions and useful macros . section . init 0 / * * EX: E 2 . 0 U 2 is
#include Include register definitions and useful macros
section init
EX: E
U is a shift register that controls the digit segment display on
the QUTy. The shift register's outputs, QQ drive the LED segments of
the display in an activelow configuration, while output Q selects the
LHS or RHS digit via U and U
The shift register has bits of internal memory which can be set using
the SPI CLK and SPI MOSI nets:
When the input connected to the SPI CLK net transitions from LOW to
HIGH rising edge bit of the internal memory is set to the current
state of the SPI MOSI net.
Simultaneously, the data in the internal memory is shifted by one bit
position to the left:
The previous value in bit is shifted to bit
The previous value in bit is shifted to bit
Equivalently:
internal memory LSLinternal memory
internal memory MOSI
When the input connected to the DISP LATCH net transitions from LOW to
HIGH rising edge the state of this internal memory sets the state
of outputs QQ:
Q internal memory
For example, if we wanted to turn all segments of the display off, we
would transmit the byte bnote Q will not affect the
displayed pattern which corresponds to pulses of the SPI CLK net
with the SPI MOSI net constantly driven HIGH.
Assuming all nets are initially driven LOW, we could:
Drive SPI MOSI HIGH
Create a rising edge on the SPI CLK net times:
a Drive SPI CLK HIGH
b Drive SPI CLK LOW to prepare for next rising edge
Create a rising edge on the DISP LATCH:
a Drive DISP LATCH HIGH
If instead, you wanted to turn some segments on you would need to drive
the SPI MOSI net to the appropriate state before creating each rising
edge on the SPI CLK net.
In this way, you can independently set each bit in the internal memory
of the shift register and consequently, the corresponding output state
QQ
TASK: Write assembly code below to configure the display on the QUTy to
display the final digit of your student number.
If the final digit of your student number is EVEN, it should be
displayed on the lefthandside LHS digit of the display.
If the final digit of your student number is ODD, it should be displayed
on the righthandside RHS digit of the display.
EXAMPLE: If your student number was n:
should be displayed on the LHS digit.
NOTE: Efficiency is not assessed in this exercise and therefore it is
not necessary to implement loops or subroutines.
entry:
CODE: Write your code for Ex E below this line.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
