CS代考 COMP2300/6300. This information is required to complete some of the questio

The Megabit and You
Charles Martin 22 April 2022
The following is important information for the 2022 mid-semester exam for COMP2300/6300. This information is required to complete some of the questions, please review this document prior to the exam (seriously, this is actually part of the exam, not practice questions).
Congratulations! You just got a job working on a new microcontroller board called the megabit.

Copyright By PowCoder代写 加微信 powcoder

The megabit is a lot like the micro:bit, except that it’s really big and so it has room for a much larger LED display. (25 x 25 LEDs).
Figure 1: The megabit is just like the microbit, but it’s huge. (incl. image by RoseBox on Unsplash)

The megabit display
Luckily for you, control of the LED display is very similar to the micro:bit’s 5×5 LED display. In fact, the megabit display is divided up into 25 sub-displays (each one is called a bank). Each bank is a 5×5 LED display that can be connected to exactly the same GPIO outputs as on the micro:bit. The LEDs are laid out like this:
Figure 2: The megabit’s 25 LED banks
The display bank control register
The megabit has one extra memory mapped register used to switch between LED banks so that you can address every LED on the display.
The display bank control register (DBCR), is located at 0x50000600 (no offset). Bits 0-24 of this register connect the LED GPIO pins to the rows and columns of the corresponding LED banks when they are set. Bits 25-31 of the register have no effect.
Multiple banks can be controlled at once (so that the same row and column will be connected in each bank). The configuration of the DBCR can be summarised

as follows: Access Field
RW BANK[i] (i=0..24)
Value ID Value
Disconnected 0 Connected 1
Description
Bank is disconnected from GPIO Bank is connected to GPIO
• Any GPIO pins that are high will be high on all connected banks.
• On banks that are not connected, all GPIO pins are low.
• The mapping between GPIO pins and the rows and columns of each bank
is the same as on the microbit. To summarise:
Row 1 Row 2 Row 3 Row 4 Row 5
P0.21 P0.22 P0.15 P0.24 P0.19
Col 1 Col 2 Col 3 Col 4 Col 5
P0.28 P0.11 P0.31 P1.05 P0.30
And remember that to light an LED, the row must be high and column must be low.
1. Bits 0, 3 and 8 are set in the DBCR, all other bits are clear.
2. P0 DIR bit 21 and 28 have been set to OUT
3. P0 OUT bit 21 has been set to HIGH
4. The top left LED of banks 0, 3, and 8 will light up. All other LEDs are
Thinking time:
• How would you implement your assignment 1 on the megabit?
• What impact would the DBCR have on controlling the LEDs?
• Are there any smart ways you can think of to control the LEDs that would
save time in certain circumstances?

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com