Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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.
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions