Changing MUX Values

Question: How do I Change the Second Level MUX or ACol1mux Value?



The second level MUX or Acol1Mux value can be changed by the bit-banging register ABF_CR - analog output buffer control register. This register happens to be a write-only register. To change the value of a write-only register, shadow registers need to be used.

1. Declare a variable to act as the shadow register - for example, MuxShadow.
2. Initialize the shadow register to have the same value as the ABF_CR register.

MuxShadow = ABF_CR

3. Do the corresponding operation on the shadow register MuxShadow to get the value for ABF_CR. For example, if bit 7 of ABF_CR ( Acol1Mux value) needs to be changed to 1,

MuxShadow or 80h

4. Now, move the value of MuxShadow into ABF_CR.