Question: Modify the code to build a system that a tactile switch connects to Port D pin 3 and Port D pin 0 connects to LED.

Modify the code to build a system that a tactile switch connects to Port D pin 3 and Port D pin 0 connects to LED. If switch is OFF, LED turns OFF. If switch is ON, LED turns on.
 Modify the code to build a system that a tactile switch
connects to Port D pin 3 and Port D pin 0 connects

15 GPIO PORTD DATA R EQU 0x400073FC 16 GPIO_PORTD_DIR R EQU 0x40007400 17 GPIO_PORTD AFSEL R EQU 0x40007420 18 GPIO _PORTD DEN R EQU 0x4000751c 19 20 SYSCTL _RCGCGPIO R EOU 0x400FE 608 21 AREA .texti. CODE, READONLY, ALIGN-2 THUMB EXPORT Start 23 24 25 GPIO Init 26 27 28 29 30 31 : 1) activate clock for Port D LDR RO, [R1] ORR RO, RO, #0x08 STR RO, [R1 NOP NOP NOP NOP : 3) set direction register LDR R1, =GPIO-PORTD-DIR-R LDR RO, [R1 ORR RO, RO, #0x08 ;BIC RO, RO, #0x02 STR RO, [R1 : 4) regular port function LDR R1, -GPIOPORTD AFSELR LDR RO, [R1 BIC RO, RO, #OxOA STR RO, [R1] : 5) enable digital port LDR R1, -GPIO PORTD DEN R ; R0 = [R1] ; [R1] = RO : allow time to finish activating 35 36 7 8 9 0 ; R1 &GPIO PORTD DIR R ; R0 = [R1] ; RO = ROI 0x08 (make PD3 output) ; RO-RO NOT (0x02) (make PDO input ) [R1]RO ; R1 = &GPIOPORTD AFSELR RO -[R1] RO RO&0xOA (disable alt funct on PD3, PDO ; [R1] =RO - - :R1&GPIO PORTD_DEN R RO [R1] LDR RO, [R1]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!