metalmisers
Junior Member level 2
- Joined
- Mar 4, 2012
- Messages
- 22
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,457
Hi guys.
I am using a TI Tiva arm micro-controller. I want to access a specific bit of a 8-bit register (GPIO_PORTF_DATA_REGISTER) and put its value in an other register. I found examples where people did like
GPIO_PORTF_DATA_REGISTER &= 0x01;
to access the first bit, but doesnt this make the 0th bit of the register 1? i just want to put the 0th bit in say In.
unsigned char In;
In = GPIO_PORTF_DATA_REGISTER|0x01; ( Is this correct?)
I am using a TI Tiva arm micro-controller. I want to access a specific bit of a 8-bit register (GPIO_PORTF_DATA_REGISTER) and put its value in an other register. I found examples where people did like
GPIO_PORTF_DATA_REGISTER &= 0x01;
to access the first bit, but doesnt this make the 0th bit of the register 1? i just want to put the 0th bit in say In.
unsigned char In;
In = GPIO_PORTF_DATA_REGISTER|0x01; ( Is this correct?)