129k views
4 votes
Write an assembly code that initializes TM4C Port B, where:

a. PB0 and PB1 are active high (positive logic) digital outputs

1 Answer

4 votes

Final answer:

To initialize TM4C Port B and make PB0 and PB1 active high digital outputs, you can use assembly code.

Step-by-step explanation:

To initialize TM4C Port B and make PB0 and PB1 active high digital outputs, you can use assembly code. Here's an example of how you can do it:

  • MOV R1, #0x03
  • LDR R0, =0x4000551C
  • STR R1, [R0]

This code first assigns the value 0x03 (which corresponds to 0b11 in binary) to register R1. Then, it loads the address 0x4000551C, which is the Control register for Port B, into register R0. Finally, it stores the value of R1 into the address pointed by R0, which sets PB0 and PB1 as active high digital outputs.

User Jesuspc
by
8.1k points