Odd thing I don't understand and haven't run into before:
Am using an ATMega328, and am setting the comparator to compare AIN1 to the 'bandgap voltage' of 1.1v
To select the BG-voltage for the comparator+, you have to set the ACBG bit in ACSR register. So I did this:
LDI r23, 1<<ACBG
This didn't work - I have verified that the comparator+ was still using AIN0, not the BG-voltage.... so ACBG-bit was still a 0.
Experimenting, I tried an "OUT" instead of "STS", and it works fine.
Confused.... I thought "OUT" was just a faster (1 cycle) way to address the low memory (registers), but "STS" works on the whole map, but takes 2 cycles.
Anybody understand this?