& bitwise AND

| bitwise OR

^ bitwise XOR

~ 1’s compliment

>> right shift

<< left shift

# Bitwise operators

Reply

Reply

& bitwise AND

| bitwise OR

^ bitwise XOR

~ 1’s compliment

>> right shift

<< left shift

Transistors: base resistor selection for saturation state.

- Need to know Maximum current load for the device to be turned on.
- Need to know minimum HFE for transistor.
- Divide (Maximum Current)/(Minimum HFE) to get the minimum base current
- Add 30% to the minimum base current to be sure the transistor is saturated.
- Use R = V/I to calculate base resistor.

Example: 5813

1. Divide the number by 256 : 5813/256 = 22.70703125

The whole number is the High Byte

2. Multiply the whole number * 256 = 22 * 256 = 5632

3. Subtract that number from the origional for the low bit: 5813-5632 = 181 (this is the low bit)

Overflow = 256 for 8 bit, 65536 for 16bit

Delay in seconds:

Delay = ((Overflow – InitTMR)*prescalar) /(Frequency/4)

Value to put in InitTMR – delay is in Seconds

InitTMR = Overflow – ((Delay * Frequency)/(4 * Prescalar))