In the PIC18F452 microcontroller, PORTB is an 8-bit bidirectional port shared with interrupt pins and serial device programming pins. Table below gives the PORTB bit functions. PORTB is controlled by registers, and they are as follows: Port data register PORTB – Port direction register TRISB – Port latch register LATB – The general operation of PORTB is similar to that of PORTA. Figure 2.24 shows the architecture of PORTB. Each port pin has a weak internal pull-up, which can be enabled by clearing bit RBPUof register INTCON2. These pull-ups are disabled on a POR and when the port pin is configured as an output. On POR, PORTB pins are configured as digital inputs. Internal pull-ups allow input devices, such as switches, to be connected to PORTB pins without the use of external pull-up resistors. This saves cost because of the reduced component count and less wiring requirements. Port pins RB4–RB7 can be used as interrupt on change inputs, whereby a change on any of pins 4–7 causes an interrupt flag to be set. The interrupt enable and flag bits RBIE and RBIF are in register INTCON.
In the PIC18F452 microcontroller, PORTB is an 8-bit bidirectional port shared with interrupt pins and serial device programming pins. Table below gives the PORTB bit functions. PORTB is controlled by registers, and they are as follows: Port data register – PORTB Port direction register – TRISB Port latch register – LATB The general operation of PORTB is similar to that of PORTA. Figure 2.24 shows the architecture of PORTB. Each port pin has a weak internal pull-up, which can be enabled by clearing bit RBPUof register INTCON2. These pull-ups are disabled on a POR and when the port pin is configured as an output. On POR, PORTB pins are configured as digital inputs. Internal pull-ups allow input devices, such as switches, to be connected to PORTB pins without the use of external pull-up resistors. This saves cost because of the reduced component count and less wiring requirements. Port pins RB4–RB7 can be used as interrupt on change inputs, whereby a change on any of pins 4–7 causes an interrupt flag to be set. The interrupt enable and flag bits RBIE and RBIF are in register INTCON.