Advertisement
Leo_F

ESINIT

Feb 27th, 2018
3,171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MPASM 0.52 KB | None | 0 0
  1. ESINIT      MOVLW   B'00100000' ; Enable transmit and choose low baud rate
  2.         MOVWF   TXSTA       ; write to reg
  3.         MOVLW   B'10010000' ; Enable recieve and serial port itself
  4.         MOVWF   RCSTA
  5.         MOVLW   D'15'       ; 9600 bps (Fosc / (64 * Speed) - 1)
  6.         MOVWF   SPBRG       ; write to reg
  7.         BCF TRISC, TX   ; Make TX pin of PORTC output
  8.         BSF TRISC, RX   ; Make RX pin of PORTC input
  9.        
  10.         BSF RCSTA, SPEN ; Enable the serial port
  11.        
  12.         BSF PIE1, RCIE  ; Enable recice interrupt enable
  13.         BSF INTCON, PEIE ; Enable peripheral interrupt enable
  14.         RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement