COS10004-Lab56-Template

docx

School

Swinburne University of Technology *

*We aren’t endorsed by this school

Course

10004

Subject

English

Date

Jan 9, 2024

Type

docx

Pages

9

Uploaded by DukeTank8613

Report
| COS10004 Lab 5 16 - Snippets of code: 16.1 Establish the base address of the GPIO registers. Insert code screenshot here 16.2 Program GPIO18 for writing. Insert code screenshot here 16.3 Set GPIO18 to ON. Insert code screenshot here 16.4 Stop the instruction pointer (program counter) from continuing beyond the executable program code. Insert code screenshot here
|
| 20. Once you are comfortable in your understanding of the GPIO registers, answer the following questions: 20.1. What number bit is set (within the associated 32-bit block) to enable GPIO23 for writing? Written response 9 20.2. What is the byte offset from GPIO_BASE that this 32-bit block must be written to in memory? Written response 8 20.3. What number bit is set to set GPIO23 to ON (again within the 32-bit block associated with that GPIO pin)? Written response 23 20.4. What is the byte offset from GPIO_BASE that this 32-bit block must be written to memory? Written response 28
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
| 21. Source code Insert code screenshot here 22. Consider how you would program one of the GPIO pins used above to turn off the LED it controls. Choose one of the LEDs to turn off, and respond the following: Written response Firstly, we have to add in the BASE and the GPIO_OFFSET which is the number we need in order to interface with the peripheral. Then in order to write in the GPIO18 we need to function register one to program for the output. Write in zero to the GPIO pin to zero setting the bit 18. 22.1. Which exact snippet of code will need to change compared to turning the LED on? Insert code screenshot here
| 22.2. Provide the alternative code to turn the LED off (again you will need to refer to the GPIO register diagram). Insert code screenshot here
|
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
| COS 10004 Lab 6 6.Error message received Insert error screenshot 7. Convert your student number to hex (only use digits from your student number, ignore any letters) Written response 103810448 = 6300590 8.1 Why does MOV only work with numbers with 24 bits set to 0? Written response There are 32 bit mov instructions that has only 8 bits available to store the value to be moved. Other 20 bits are used for op-code and the remaining 4 bits are for ROR. If MOV command is greater than 8 then this take up remaining bits so it set to 24 setting zero. 8.2 How can MOV still be used for numbers that do not satisfy this? Written response We can make use of ORR command along with MOV and build a 32 bit number by combining parts 8.3 Identify the three bytes (as hex digits) needed to construct your student number and write the code to load the entire number into a register. Written response/code screenshot 103810448-----0x6300590
| 12. Note if you were successful in getting the LED to flash. Did you find this easy or challenging? Written response Yes , I found out quite it challenging at first. But after the explanation it was easier to convert the bytes after the understanding the law of conversion, it became much easier. 15. Think about how you would modify this code so that it implements 3 flashes followed by a pause. It will require two extra loops. Written response
| 16. Now implement your proposed code, setting the time interval to three (3) seconds (0x2DC6C0). Insert code screenshot here
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help