Software: Pitfalls!
Read-Modify-Write CAN BE SERIOUS! (Uplink)
BCF/BSF PORTn Does the following:
- Reads in the PORTn byte
- Clears/sets the bit
- Write the whole byte back.
- BUT! If something external pulls a different output pin low or high, the pin will change to that value!
Shadowed I/O
-
bsf _PORTA
movf _PORTA, W
movwf PORTA
Previous slide | Next slide | Back to first slide | View graphic version |