Bit Specific Assembly Definitions

Click For Summary

Discussion Overview

The discussion revolves around the interpretation of bit-specific assembly definitions for the LM4F120H5QR microcontroller, particularly focusing on the definition of port A bits and their corresponding addresses in ARM assembly language.

Discussion Character

  • Technical explanation, Conceptual clarification, Debate/contested

Main Points Raised

  • One participant questions the definition of PA5 equ 0x40004080, expressing confusion about how bit 5 corresponds to the address 0x80.
  • Another participant seeks clarification on how a bit could be represented as 0x20, suggesting a misunderstanding of bit representation.
  • A participant explains that the microcontroller is 32-bit and that the example is meant to illustrate a bit-specific assembly definition.
  • One reply speculates about the structure of registers associated with a port, proposing that different addresses correspond to receive, write, and data registers.
  • A participant inquires whether bit 5 of port A refers to the data bit of pin A5, indicating a lack of familiarity with this convention.

Areas of Agreement / Disagreement

Participants express confusion and differing interpretations regarding the assembly definitions and the addressing of bits, indicating that multiple competing views remain without a clear consensus.

Contextual Notes

There are assumptions about the structure of the microcontroller's registers and the conventions used in the assembly language that are not fully clarified, leading to uncertainty in the discussion.

Who May Find This Useful

Individuals interested in ARM assembly programming, particularly those working with the LM4F120H5QR microcontroller, may find this discussion relevant.

sandy.bridge
Messages
797
Reaction score
1
I have an example given in the textbook that defines port A bits 5 as PA5 equ 0x40004080. Port A is 0x40004000, and the first 7 bits are for data. I do not see how bit 5 is 0x80. I figured that would be bit 7 and bits 5 would be 0x20. We use ARM assembly language for LM4F120H5QR microcontroller.
 
Engineering news on Phys.org
I'm not sure your question but follows.
How could a bit be set to 0x20 (a byte)

Perhaps you could clarify a bit :)
 
It is a 32-bit microcontroller. This is simply supposed to be a bit specific assembly definition. The example that is given is for PORT A and the bits defined are 5. The answer is PA5 equ 0x40004080, and I don't really see why.
 
Okay sorry I'm a bit slow sometimes I see what you are asking.
I've never actually programmed the LM4F120H5QR, but in other cases there were 3 registers associated with a port. A Receive enable, a Write enable and a data register.

My guess is what's happening then is for PINA0 0x40004000 would be the receive 0x40004001 would be the write 0x40004002 would be the data.
Extending this out to port 5, you would get 0x40004080 for the data.
Again this is all supposition :) hopefully it'll point you in the right direction
 
So when they refer to bit 5 of port A, they are referring to the data bit of pin A5? I have never encountered this before and I was scanning through the data sheet to see if that would help.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
7
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
7
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
6
Views
4K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
Replies
60
Views
18K
  • · Replies 4 ·
Replies
4
Views
2K