Tools: RCInput_UART PIC firmware: add informative comments

This commit is contained in:
Gustavo Jose de Sousa 2015-10-05 15:07:54 -03:00 committed by Andrew Tridgell
parent 8110104361
commit 2a7e4baa7d
1 changed files with 8 additions and 8 deletions

View File

@ -203,7 +203,7 @@ Main:
bsf STATUS, RP0 bsf STATUS, RP0
movlw (b'111'<<IRCF0) movlw (b'111'<<IRCF0)
movwf OSCCON movwf OSCCON ; set internal oscillator frequency to 8 MHz
movlw (0<<NOT_RABPU) movlw (0<<NOT_RABPU)
movwf OPTION_REG movwf OPTION_REG
@ -215,9 +215,9 @@ Main:
; ||||,-- input 2 ; ||||,-- input 2
; |||||,- input 1 ; |||||,- input 1
movlw b'11111111' movlw b'11111111'
movwf TRISA movwf TRISA ; set PORTA as input
movwf WPUA movwf WPUA ; enable weak pull-up
movwf IOCA movwf IOCA ; enable interrupt-on-change
; ,-------- tx ; ,-------- tx
; |,------- input 6 ; |,------- input 6
@ -236,12 +236,12 @@ Main:
movwf TRISC movwf TRISC
movlw (1<<TXEN|1<<BRGH) movlw (1<<TXEN|1<<BRGH)
movwf TXSTA movwf TXSTA ; enable async transmitter and select high baud rate
movlw (1<<BRG16) movlw (1<<BRG16)
movwf BAUDCTL movwf BAUDCTL ; 16-bit baud rate generator
movlw .16 movlw .16 ; use value 16 for SPBRG:SPBRGH to get 115200bps baud rate
movwf SPBRG movwf SPBRG
clrf SPBRGH clrf SPBRGH
@ -274,7 +274,7 @@ Main:
movwf RCSTA movwf RCSTA
movlw (1<<T1CKPS0|1<<TMR1ON) movlw (1<<T1CKPS0|1<<TMR1ON)
movwf T1CON movwf T1CON ; enable timer and set frequency to 1MHz (=8Mhz/4/2)
movlw (1<<GIE|1<<PEIE|1<<RABIE) movlw (1<<GIE|1<<PEIE|1<<RABIE)
movwf INTCON movwf INTCON