#### AND, OR and NOT Bitwise Logical Operations

Understanding the 'AND', 'OR' and 'NOT' bitwise logical operations on paper.

#### OR Bitwise Arithmetic (Set a Bit High)

Bitwise aritimetic to set a specific bit to 1 in an 8-bit number without affecting the neighboring bits in that number. Understanding the logical 'OR' bitwise operation on paper.

#### AND and NOT Bitwise Arithmetic (Set a Bit Low)

Bitwise arithmetic to set a specific bit to a 0 (or clear a bit) in an 8-bit number without affecting the neighboring bits in that number. Understanding the logical 'AND' and 'NOT' bitwise operation on paper.

#### Bitwise OR Operation in Program

Programatically understanding the logical 'OR' bitwise operation. Bitwise aritimetic to set a specific bit to 1 in an 8-bit number without affecting the neighboring bits in that number.

#### Bitwise Shift Operations 'OR'

Programatically understanding shift operations used in the bitwise 'OR' operation.

#### In Program: XOR Bitwise Operaion

Programatically using the 'XOR' bitwise operations to toggle a specific bit in an 8-bit number. This is useful if you want to turn the same bit on and off in sequence.

#### Programming: ADC (Analog to Digital Converter) Setting the Left or Right Shift for the Result

Setting either a left shift or right shift for the result will make it easier to grab the data for 8-bit or 10-bit. It is how the number will be placed within the register that will hold the data. The number will be placed in the register as left justified or right justified using terminology from word processors. This is important because the data will reside in two registers, because a 10-bit number will not fit in just one 8-bit register.

The bit that needs to be set is ADLAR if you want the data to be shifted to the left. This will put the 8-bit information in one register called the ADCH (ADC High) and make it very easy to get the number without having to do any bitwise manipulations.

#### On Paper: ADC (Analog to Digital Conversion) Getting the 10-bit number from the ADCH and ADCL Registers

When a 10-bit number is desired from the ADC conversion, both the ADCH and ADCL must be used to get the full 10-bit number. The ADC stores the conversion in the ADCH and ADCL registers.

First, the ADCL register must be accessed and saved into another variable. The is a rule that must be followed when trying to get the 10-bit number.

Second, a variable will be needed to store the 10-bit conversion. A 16-bit variable is used. A bitwise shift operation will be used to get the data into the variable correctly. Both left adjusted (ADLAR = 1) and right adjusted (ADLAR = 0) will be shown.

#### Programming: ADC (Analog to Digital Conversion) Getting the 10-bit number from the ADCH and ADCL Registers

When a 10-bit number is desired from the ADC conversion, both the ADCH and ADCL must be used to get the full 10-bit number. The ADC stores the conversion in the ADCH and ADCL registers.

First, the ADCL register must be accessed and saved into another variable. The is a rule that must be followed when trying to get the 10-bit number.

Second, a variable will be needed to store the 10-bit conversion. A 16-bit variable is used. A bitwise shift operation will be used to get the data into the variable correctly. The Right Adjusted method ADLAR = 0 is shown in this case.

#### Programming: Using the Shift Bitwise Operation to Put Binary Digits Anywhere Within Another Binary Number.

Using the bitwise shift operator is a very powerful feature. A number from one binary number can be put into another variable into any digit

#### Programming: ADC (Analog to Digital Conversion) Getting the 10-bit number from the ADCH and ADCL Registers

When a 10-bit number is desired from the ADC conversion, both the ADCH and ADCL must be used to get the full 10-bit number. The ADC stores the conversion in the ADCH and ADCL registers.

First, the ADCL register must be accessed and saved into another variable. The is a rule that must be followed when trying to get the 10-bit number.

Second, a variable will be needed to store the 10-bit conversion. A 16-bit variable is used. A bitwise shift operation will be used to get the data into the variable correctly. The Right Adjusted method ADLAR = 0 is shown in this case.

#### Result: ADC (Analog to Digital Conversion) Getting the 10-bit number from the ADCH and ADCL Registers

Result of hte ADC 10-bit conversion shown on the LDC.

When a 10-bit number is desired from the ADC conversion, both the ADCH and ADCL must be used to get the full 10-bit number. The ADC stores the conversion in the ADCH and ADCL registers.

First, the ADCL register must be accessed and saved into another variable. The is a rule that must be followed when trying to get the 10-bit number.

Second, a variable will be needed to store the 10-bit conversion. A 16-bit variable is used. A bitwise shift operation will be used to get the data into the variable correctly. The Right Adjusted method ADLAR = 0 is shown in this case.

#### Programming: Combining Multiple Or Bitwise Operations in One Register.

Multiple bitwise operations can be expressed in a single line. This is an example of taking two Or bitwise operations that were on two lines and combined into one line.

The ADLAR is not set in this program because it is 0 (right adjusted) by default.

When a 10-bit number is desired from the ADC conversion, both the ADCH and ADCL must be used to get the full 10-bit number. The ADC stores the conversion in the ADCH and ADCL registers.

First, the ADCL register must be accessed and saved into another variable. The is a rule that must be followed when trying to get the 10-bit number.

Second, a variable will be needed to store the 10-bit conversion. A 16-bit variable is used. A bitwise shift operation will be used to get the data into the variable correctly.