' Define the oscillator’s frequency in MHz. ' The default = 4. define OSC 4 ' Enable the port and receiver. define HSER_RCSTA 90h ' Enable the transmitter and set BRGH = 1. define HSER_TXSTA 24h ' Set the bit rate. define HSER_BAUD 1200 ' Clear serial-port overflow errors automatically. define HSER_CLROERR serial_in var BYTE received_text var BYTE[5] ' PORTB.1 is an output that drives an LED. TRISB.1 = 0 ' Enable unmasked peripheral interrupts  INTCON = %11000000 ' Enable the serial receive interrupt  PIE1 = %00100000 on interrupt goto receive_serial_data ' The main program loop. loop: ' Perform additional actions here. goto loop end Listing 1. A series of registers configures the serial port and the serial interrupt.