Bit Specific Assembly Definitions

AI Thread Summary
Port A bits are defined in the context of the LM4F120H5QR microcontroller, with PA5 specifically equating to 0x40004080. The confusion arises from the interpretation of bit positions, where bit 5 corresponds to the 0x80 value, not 0x20 as initially thought. In this 32-bit microcontroller, each port has associated registers for receiving, writing, and data, which may clarify the address structure. The discussion highlights the importance of understanding bit-specific definitions in assembly language programming. Overall, the conversation emphasizes the need for clarity when interpreting microcontroller documentation.
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.
 
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Hello dear reader, a brief introduction: Some 4 years ago someone started developing health related issues, apparently due to exposure to RF & ELF related frequencies and/or fields (Magnetic). This is currently becoming known as EHS. (Electromagnetic hypersensitivity is a claimed sensitivity to electromagnetic fields, to which adverse symptoms are attributed.) She experiences a deep burning sensation throughout her entire body, leaving her in pain and exhausted after a pulse has occurred...
Back
Top