INSTRUCTIONS: Show all your work. Hand in a hardcopy. Blackboard solutions will not be accepted.
Use the tables below to answer the following questions.
7. To make a pin a digital input, what value do you load into corresponding bits the following registers? Assume it does not need an internal pullup
DIR
PUR
PCTL
AFSEL
AMSEL
DEN
8. To make a pin a digital output, what value do you load into corresponding bits the following registers? Assume it does not need an internal pullup
DIR
PUR
PCTL
AFSEL
AMSEL
DEN
9 Which line of C code is a friendly way to set Port B bit 2 assuming this pin has already been initialized as an output
GPIO_PORTB_DATA_R = 0x00;
GPIO_PORTB_DATA_R = 0x02;
GPIO_PORTB_DATA_R = 0x04;
GPIO_PORTB_DATA_R |= 0x02;
GPIO_PORTB_DATA_R |= 0x04;
GPIO_PORTB_DATA_R &= 0x02;
GPIO_PORTB_DATA_R &= 0x04;
GPIO_PORTB_DATA_R &= ~0x02;
GPIO_PORTB_DATA_R &= ~0x04;
10. How would you program the GPIO registers to make PF5 and PF2 input, and make PF3 PF1 and PF0 outputs?
WhatsApp us