Peripherals: Ports
Ports have two control registers
- TRIS sets whether each pin is an input or output
- PORT sets their output bit levels
- WARNING: Other peripherals may steal pins!So in this respect Peripheral registers control PORTs as well.
Most pins have 25mA source/sink (LED enabled)
- Note that you gotta look it up; not all pins are this way.
Be wary of Read-Modify-Write!
Floating input pins draw Class A current! Tie off your pins (or set them to outputs) if you don’t want to draw a billion mA.
Previous slide | Next slide | Back to first slide | View graphic version |