首页 > > 详细

EEE2007辅导、programming辅导、讲解C/C++编程设计、讲解C++语言 调试C/C++编程|讲解留学生Processing

EEE2007 Emergency Regulations Microprocessor Reassessment
Page 1 of 5
EEE2007: EMERGENCY REGULATIONS RESIT
Microprocessor Assessment
The reassessment for EEE2007 is in two parts. This document deals
with the microprocessor part, while the companion document describes
the work required in C programming. Each part will count for half of the
total marks for the reassessment.
The microprocessor work described here is a variation of the practical
exercise that you did in the lab in the autumn, but is now entirely
software based. It will require about two days in total to complete, but
should not be done continuously. You should allow breaks for
consideration of ideas.
For reference, the specification of the original version of this exercise
that you have already done is presented below. It is followed by the new
version that can be done at home.
Original Specification for lab exercise
Step 1.
Design a microprocessor system that displays an alternating red / green
indication on a bi-colour LED. In step 2, this will be substantially modified
and then developed into a PCB. At this stage, just draw the circuit
diagram on paper.
Your system will be based on the MCF51JF128 Coldfire+
microprocessor with the 28BV64 EEPROM, operating on a 3.3V supply.
It may use any of the following logic devices from the advanced highspeed
CMOS series, for which the data is available at www.ti.com.
74AHC00NQuad 2-input NAND
74AHC02NQuad 2-input NOR
74AHC04NHex invertor
74AHC08NQuad 2-input AND
74AHC32NQuad 2-input OR
74AHC74NDual D-type flip-flop
74AHC125N Quad 3-state buffer
EEE2007 Emergency Regulations Microprocessor Reassessment
Page 2 of 5
Step 2.
Modify the design to include a push-button switch. The LED only
alternates colours when the switch is pressed. Otherwise it remains at
red. Bring the connections from the LED onto a header plug.
Step 3.
Modify your programme such that on power-up the LED is red but, when
the switch is pressed, gradually fades through orange and yellow to
green. When the switch is released the LED maintains its current setting.
Once this is working, you can remove the LED and use the pulsing
output duplicated on the plug to control an amplifier, driving another
piece of equipment such as a DC motor.
New Specification for Assessment
Step 1.
You may find it helpful to review the hardware design and software that
you produced in the lab.
You can use the original lab exercise to familiarise yourself with the
simulator. This is the public-domain software that you used last year.
From www.easy68k.com download the file setupeasy68k.exe, and install
it.
Your systems include an LED that is set by a write to any address, and a
switch, the state of which is determined by reading from any address
with A13 at logic-1, that is, from address 2000H. The following
programme is what we gave you to get you started on your own
hardware, but it will also work on the simulator. Enter this code,
assemble it (project > assemble source), and assuming there are no
errors, execute it.
EEE2007 Emergency Regulations Microprocessor Reassessment
Page 3 of 5
ORG $1000
led equ $000000
sw equ $002000
START: ; first instruction of program
* Put program code here
start move.b #$01,d0 ;led on
move.b d0,led
move #4000,d0 ;delay
loop0 sub #1,d0
bne loop0
move.b #$00,d0 ;led off
move.b d0,led
move #4000,d0 ;delay
loop1 sub #1,d0
bne loop1
bra start ;repeat
SIMHALT ; halt simulator
* Put variables and constants here
END START ; last line of source
With the simulator running, display the hardware devices (view >
hardware). In the box beside the row of eight LEDs, set their address to
000000 to correspond with the address used in the programme. Click
the run button (second from left), and LED 0 should flash repeatedly.
Look at the code, and be sure that you understand it. Two points need
further explanation:
• You will see that the delay between flashes is implemented simply
by setting a value in a register, and repeatedly decrementing it
until it reaches zero. The time taken to execute an instruction on
the simulator depends on the computer on which you are running
it, and has no relationship to the time that would really have been
taken to execute the instruction on the hardware. Therefore the
flashing may appear to be unreasonably fast or slow, or at irregular
intervals, and you may have to experiment with different delay
values.
• By default, instructions act on 16-bit quantities. When you are
reading from or writing to the switch or LED, however, you only
want to transfer 8 bits. Therefore these instructions are suffixed
'.b', to show that the only act on a byte.
EEE2007 Emergency Regulations Microprocessor Reassessment
Page 4 of 5
Step 2.
Now modify the programme to test the state of one of the push-button
switches. The LED should only flash when the switch is pressed. Set the
address of the switches to 002000, to correspond with the address used
on your boards.
Step 3.
Include four LEDs, connected to bits 0..3 of the data bus. Pulse these in
the following repeating pattern.
LED 3 LED 2 LED 1 LED 0
0 0 1 1
0 1 1 0
1 1 0 0
1 0 0 1
then back to
0 0 1 1
When the switch is pressed and then released, the shift pattern changes
direction.
You can now imagine that these LED outputs are replaced with signals
to the four windings of a stepper motor. The motor runs at a constant
speed, and the direction is reversed by pressing the switch.
Your programme should be neatly structured, and programmed in a
reasonably concise way. For example, consider the use of a shift
instruction to generate the output patterns, rather than coding each
output separately.
Marking
This part of the resit coursework will count for 50% of the total. The C
programming assignment will contribute the other 50%.
Communications
You can contact me directly at j.n.coleman@ncl.ac.uk.
Submission
You should submit a single document containing the assembled listing of
your programme (the output from the assembler, not the source file),
EEE2007 Emergency Regulations Microprocessor Reassessment
Page 5 of 5
together with a short note describing how well your programme worked
and any unresolved problems. Make sure you have shown your name!
You will also need to submit the file for the C programming. The two files
should be submitted separately, but both by 2 pm British Summer Time
on Friday 4th September, 2020, through the Canvas submission point
identified as the 'Coursework Resubmission due 4th Sept.'.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!