Mercurial > public > hwos_code
comparison src/eeprom_rs232.asm @ 218:8fbd8c5ac51f
1.71beta start
author | heinrichsweikamp |
---|---|
date | Fri, 19 Dec 2014 17:56:40 +0100 |
parents | 56276a2418f9 |
children | 5a4801918be9 |
comparison
equal
deleted
inserted
replaced
217:3f169eff873c | 218:8fbd8c5ac51f |
---|---|
151 call speed_normal ; 16MHz | 151 call speed_normal ; 16MHz |
152 enable_rs232_2: | 152 enable_rs232_2: |
153 movlw T2CON_NORMAL | 153 movlw T2CON_NORMAL |
154 cpfseq T2CON | 154 cpfseq T2CON |
155 bra enable_rs232_2 ; Wait until speed is normal | 155 bra enable_rs232_2 ; Wait until speed is normal |
156 bcf PORTE,0 ; Start comms | |
156 ;init serial port1 (TRISC6/7) | 157 ;init serial port1 (TRISC6/7) |
157 movlw b'00100100' ; BRGH=1, SYNC=0 | 158 movlw b'00100100' ; BRGH=1, SYNC=0 |
158 movwf TXSTA1 | 159 movwf TXSTA1 |
159 movlw b'10010000' | 160 movlw b'10010000' |
160 movwf RCSTA1 | 161 movwf RCSTA1 |
163 global disable_rs232 | 164 global disable_rs232 |
164 disable_rs232: | 165 disable_rs232: |
165 clrf RCSTA1 | 166 clrf RCSTA1 |
166 clrf TXSTA1 ; UART disable | 167 clrf TXSTA1 ; UART disable |
167 bcf PORTC,6 ; TX hard to GND | 168 bcf PORTC,6 ; TX hard to GND |
169 bsf PORTE,0 ; Stop comms | |
168 return | 170 return |
169 | 171 |
170 global rs232_wait_tx | 172 global rs232_wait_tx |
171 rs232_wait_tx: | 173 rs232_wait_tx: |
172 btfss TXSTA1,TRMT ; RS232 Busy? | 174 btfss TXSTA1,TRMT ; RS232 Busy? |