When doing ACSR |=(1<<ACD)|(1<<ACBG) are the rest of the bits (on the right side of the equation) assumed to be 0? or do they need to be explicitly defined?
The 1 on the right hand side has exactly one bit set. Consequently all others are zero.
You are setting those two bits and leaving the others unchanged. If you want to set those two and clear the rest:
ACSR = (1<<ACD) | (1<<ACBG);
Note: In the Analog Compare Status Register, Bit 5 (ACO) is read-only. It doesn't matter what you try to write to it.
Note: In the Analog Compare Status Register, Bit 4 (ACI) is an interrupt flag. It gets CLEARED if you write a 1 to it.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.