Embedded Systems · Microcontrollers, memory-mapped I/O, and peripherals
GPIOA on Anvil-M0 provides three 32-bit registers that affect the same 16 output…
Problem
Embedded Systems practice problemGPIOA on Anvil-M0 provides three 32-bit registers that affect the same 16 output latches . Unused upper bits of each register read as zero and ignore writes. Starting value: . The port pins are all outputs.
• A write of word to replaces by .
• A write of word to sets every latch for which and leaves latches with unchanged.
• A write of word to clears every latch for which and leaves latches with unchanged.
The desired update is: set pin , clear pin , and leave every other latch unchanged. No concurrent writer exists. Ignore pull-ups, modes, and BSRR.
(a) Decode into bits through . State the present values of pins and .
(b) Compute the 16-bit image that a read-modify-write to must write, namely , and give it as four hexadecimal digits.
(c) Compute a write word and a write word that together realize the same update (order: SET then CLR). Give each as eight hexadecimal digits, with bits equal to .
(d) Starting from , determine the that results if the firmware writes to instead of to , intending to “set pin .” Identify every latch that is corrupted relative to the requirement. Then state, using only the three register semantics, why a SET write of does not have that corruption.
Hint
HintWriting ODR replaces every latch; writing SET or CLR names only the one-bits.
Check your work
Work the problem yourself first. Then open it in Training to check your answer and read the full worked solution.
Create a free account to check your answer and see the solution. Create a free account.
More Embedded Systems practice problems
- A 12-bit ADC with V_REF=3.300 V and V_LSB=V_REF/4096 is read sixteen times in…Microcontrollers, memory-mapped I/O, and peripherals
- USART2 is clocked by f_CK=36.00 MHzInterrupts, concurrency, and shared state
- A UART RX FIFO is 16 bytes deepInterrupts, concurrency, and shared state
- A complementary PWM pair drives one leg of an H-bridgeTimers, scheduling, and real-time constraints
- Two 16-bit timers are cascaded to form a 32-bit timestampTimers, scheduling, and real-time constraints
- A brushless-DC commutation computer runs two independent implicit-deadline periodic…Serial buses and communication protocols
- A single fully preemptive uniprocessor hosts three independent implicit-deadline…Serial buses and communication protocols
- Standard-mode I²C requires t_LOW ≥ 4.70 μs and t_HIGH ≥ 4.00 μs on SCL, t_r ≤ 1.00 μs…Memory, energy, and reliability budgets
- A two-door airlock is modelled by Boolean variables L and R, each 1 when that door is…State-machine verification and safety boundaries