Accessing Bit

Discussion in 'The Projects Forum' started by yellowcloud, Oct 4, 2013.

  1. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    Hi.. i want to know how to address a Bit of a stored byte in the memory of the microcontroller.

    for example, i have 10011011, as stored in mermory 1. i want to address the 3rd bit starting to the right. or, Memory 1, Bit 3 get value.

    What model of microcontroller can do that?

    thanks for the posts!
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    I think all controller cores have bit operations in their instruction set. Most often this is also supported in high level compilers like C
    yellowcloud likes this.
  3. Papabravo


    Feb 24, 2006
    8051, PIC, ATmega, ARM can all do it.
    yellowcloud likes this.
  4. MrChips


    Oct 2, 2009
    Any and all microcontrollers can do this.

    Some controllers have single bit access instructions, i.e. you can set or clear a single bit or you can test the status of a single bit.

    Not all microcontrollers have this feature. But there is a simple way to implement this. All you have to do is learn how boolean OR and AND operators work. You can do this in either assembler or C (or any other language). Choose your language.
    yellowcloud likes this.