Task 1 [Pass criteria: P4] a) In order to explain the main instruction groups-
Task 1 [Pass criteria: P4]
a) In order to explain the main instruction groups, you are required to annotate each line of code of the program above by explaining their meaning.
b) In addition, explain the purpose of the program sections – SETUP, ROTATE, DELAY and DIRECTION; including the role of the special function registers (SFRs) used in the program
Guidance: Take a copy of the program and paste it into your assessment answer and fill in the missing comment lines from ‘SETUP’ to ‘END’ in the same format as lines 1-3.
Checklist of evidence required: T1 – Include a copy of the program with code comments, and a 300-word report
Task 2 [P5]
a) Rewrite the delay section of the program as a subroutine with annotations. Also show how it works by including a ‘printscreen’ of the whole program.
b) Explain the subroutine section and state two advantages a subroutine might have over keeping the delay section within the main program
c) Explain with the aid of a diagram how the microprocessor stack operates and its main purpose.
Guidance: Use MPLAB to check that the code ‘builds’ correctly (this will check the syntax), print-screen a copy of code and build result into your answer and also email as ‘U19A2T2.asm’. Highlight all changes to the program in red. There is no requirement to run or test the program.
Checklist of evidence required: T2 –Include copy of updated program, evidence of successful build, asm code file and a 300-word report with appropriate diagrams
Task 3 [P6]
a) Rewrite the delay section of the program again using a built-in Timer0 function with annotations.
b) Also explain with aid of a diagram how the timer function counts the delay, including the role carried out by 3 key SFRs used in the program (different SFRs to those in task 1)
c) State two advantages an interrupt function might have over a subroutine
Guidance: Use MPLAB to check that the code ‘builds’ correctly (this will check the syntax), print-screen a copy of code and build result into your answer and also email as ‘U19A2T3.asm’. Highlight all changes to the program in red. There is no requirement to run or test the program.
Checklist of evidence required: T3 –Include copy of updated of program, evidence of successful build, asm code file, and a 300-word report
Task 4 [P7]
a) From task 1 select MPLAB to build, run and test the program application.
b) Changing the delay loop from 0X032 to 0X002 in order to speed up the process in the simulator. Comment on your test (Watch) results explaining the values stored in the SFR and variable registers.
Guidance: To test, you will need to Take a print-screen of the simulation running and use ‘View -> Watch’ to show evidence of the operation of key variables (symbols) and SFRs such as: J&K counters, the working, status and port registers; and also email as ‘U19A2T4.asm’.
Checklist of evidence required: T4 –Include images (snip/printscreen) of your program code, and testing with appropriate watch windows, asm code file and a 100-word commentary