Skip to main content
added 122 characters in body
Source Link
Bruce Abbott
  • 57k
  • 1
  • 49
  • 94

Pins with analog inputs are set to analog input mode by default. To read a digital input you must clear the corresponding ANSEL or ANSELH bit. RB0 is AN12, so you need to clear ANS12 (bit 4 in ANSELH).

Pins set to output mode are not affected by the analog input settings. However a read-modify-write operation may fail if it needs to know the pin state and the pin is set to analog input mode.

Pins with analog inputs are set to analog input mode by default. To read a digital input you must clear the corresponding ANSEL or ANSELH bit. RB0 is AN12, so you need to clear ANS12 (bit 4 in ANSELH).

Pins set to output mode are not affected by the analog input settings.

Pins with analog inputs are set to analog input mode by default. To read a digital input you must clear the corresponding ANSEL or ANSELH bit. RB0 is AN12, so you need to clear ANS12 (bit 4 in ANSELH).

Pins set to output mode are not affected by the analog input settings. However a read-modify-write operation may fail if it needs to know the pin state and the pin is set to analog input mode.

Source Link
Bruce Abbott
  • 57k
  • 1
  • 49
  • 94

Pins with analog inputs are set to analog input mode by default. To read a digital input you must clear the corresponding ANSEL or ANSELH bit. RB0 is AN12, so you need to clear ANS12 (bit 4 in ANSELH).

Pins set to output mode are not affected by the analog input settings.