comparison code_part1/OSTC_code_asm_part1/interface.asm @ 350:7250ca7c8d24 64kByte Logbook

64kByte logbook (Still incompatible to existing PC software)
author heinrichsweikamp
date Tue, 31 May 2011 19:43:29 +0200
parents 85ea09d3b9d8
children 5c186a72cb5d
comparison
equal deleted inserted replaced
349:ed137d66ac65 350:7250ca7c8d24
217 bra menu_interface2 ; go on 217 bra menu_interface2 ; go on
218 218
219 menu_interface4: 219 menu_interface4:
220 bsf SSPCON2, PEN ; Stop 220 bsf SSPCON2, PEN ; Stop
221 call WaitMSSP 221 call WaitMSSP
222 222
223
224 clrf uart1_temp ; low address counter
225 clrf uart2_temp ; high address counter
226
227 menu_interface5: ;Send another 32kB from Block2....
228 bsf SSPCON2,SEN ; Start condition
229 call WaitMSSP
230
231 movlw b'10101110' ; Bit0=0: WRITE, Bit0=1: READ
232 movwf SSPBUF ; control byte
233 call WaitMSSP
234 btfsc SSPCON2,ACKSTAT
235 bra menu_interface5 ; No Ack, try again!
236
237 movff eeprom_address+1,SSPBUF ; High Address byte
238 call WaitMSSP
239 call I2C_WaitforACK
240 movff eeprom_address+0,SSPBUF ; Low Address byte
241 call WaitMSSP
242 call I2C_WaitforACK
243 bsf SSPCON2,RSEN ; Start condition
244 call WaitMSSP
245
246 movlw b'10101111' ; Bit0=0: WRITE, Bit0=1: READ
247 movwf SSPBUF ; control byte
248 call WaitMSSP
249 call I2C_WaitforACK
250
251 menu_interface6:
252 call rs232_wait_tx ; wait for UART
253
254 bsf SSPCON2, RCEN ; Enable recieve mode
255 call WaitMSSP
256
257 movff SSPBUF, TXREG
258
259 movlw d'1'
260 addwf uart1_temp,F
261 movlw d'0'
262 addwfc uart2_temp,F
263
264 btfsc uart2_temp,7 ; 32KB done?
265 bra menu_interface7 ; Yes
266
267 bsf SSPCON2, ACKEN ; Ack
268 call WaitMSSP
269 bra menu_interface6 ; go on
270
271 menu_interface7:
272 bsf SSPCON2, PEN ; Stop
273 call WaitMSSP
274
223 DISPLAYTEXT .20 ; Done. 275 DISPLAYTEXT .20 ; Done.
224 276
225 WAITMS d'250' 277 WAITMS d'250'
226 bcf LED_blue 278 bcf LED_blue
227 bsf PIE1,RCIE ; Interrupt for RS232 279 bsf PIE1,RCIE ; Interrupt for RS232