Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/eeprom_rs232.asm @ 50:c97c5514b165
1.70..
author | heinrichsweikamp |
---|---|
date | Thu, 29 Jul 2010 13:23:08 +0200 |
parents | 73014f788032 |
children | 4ec488f046f4 |
comparison
equal
deleted
inserted
replaced
49:cd5b650920f6 | 50:c97c5514b165 |
---|---|
113 btfsc EECON1,WR | 113 btfsc EECON1,WR |
114 bra write_eep2 ; wait about 4ms... | 114 bra write_eep2 ; wait about 4ms... |
115 bcf EECON1,WREN | 115 bcf EECON1,WREN |
116 return | 116 return |
117 | 117 |
118 | |
119 | |
120 ; RS232 Routines: | |
121 ;enable_rs232_19k2_tx: | |
122 ; bsf TRISC,6 ; TX Pin | |
123 ; movlw b'00100100' ; initialise serial port for 19200/8/N/1 BRGH=1 | |
124 ; movwf TXSTA | |
125 ; return | |
126 ; | |
127 ;disable_rs232_19k2_tx: | |
128 ; bcf TRISC,6 ; TX Pin | |
129 ; movlw b'00000100' ; Only receiver mode, BRGH=1 | |
130 ; movwf TXSTA | |
131 ; bsf PORTC,6 ; TX PIN | |
132 ; return | |
133 ; | |
134 ;enable_rs232_19k2: | |
135 ; bsf TRISC,6 ; TX Pin IO Ports must be input in order to activate the module | |
136 ; bsf TRISC,7 ; RX Pin | |
137 ; | |
138 ; movlw b'00100100' ; initialise serial port for 19200/8/N/1 BRGH=1 | |
139 ; movwf TXSTA | |
140 ; movlw b'10000000' | |
141 ; movwf RCSTA | |
142 ; movlw b'00001000' ; BRG16=1 | |
143 ; movwf BAUDCON | |
144 ; bsf RCSTA,CREN ; Enable | |
145 ; movlw d'0' | |
146 ; movwf SPBRGH | |
147 ; movlw d'207' ; Take care of the baud rate when changing Fosc! | |
148 ; movwf SPBRG | |
149 ; clrf RCREG | |
150 ; bcf PIE1,RCIE ; disable interrupt for RS232 | |
151 ; clrf PIR1 | |
152 ; return | |
153 ; | |
154 | |
155 enable_rs232: ;IO Ports must be input in order to activate the module | 118 enable_rs232: ;IO Ports must be input in order to activate the module |
156 bsf TRISC,6 ; TX Pin | 119 bsf TRISC,6 ; TX Pin |
157 bsf TRISC,7 ; RX Pin | 120 bsf TRISC,7 ; RX Pin |
158 | 121 |
159 movlw b'00100100' ; BRGH=1 | 122 movlw b'00100100' ; BRGH=1 |