comparison code_part1/OSTC_code_asm_part1/eeprom_rs232.asm @ 21:73014f788032

1.60 stable rc1
author heinrichsweikamp
date Wed, 21 Apr 2010 17:37:30 +0200
parents 96a35aeda5f2
children c97c5514b165
comparison
equal deleted inserted replaced
20:8824446f7241 21:73014f788032
58 bsf no_sensor_int ; No Sensor Interrupt 58 bsf no_sensor_int ; No Sensor Interrupt
59 movlw d'4' 59 movlw d'4'
60 movwf EEADR 60 movwf EEADR
61 bcf PIE1,RCIE ; no interrupt for UART 61 bcf PIE1,RCIE ; no interrupt for UART
62 bcf PIR1,RCIF ; clear flag 62 bcf PIR1,RCIF ; clear flag
63 call set_LEDusb ; LEDusb ON 63 bsf LED_blue ; LEDusb ON
64 64
65 internal_eeprom_access2: 65 internal_eeprom_access2:
66 rcall rs232_get_byte ; Get byte to write... 66 rcall rs232_get_byte ; Get byte to write...
67 movff RCREG,EEDATA ; copy to write register 67 movff RCREG,EEDATA ; copy to write register
68 call set_LEDy ; show activity 68 bsf LED_red ; show activity
69 69
70 btfsc rs232_recieve_overflow ; overflow recieved? 70 btfsc rs232_recieve_overflow ; overflow recieved?
71 bra internal_eeprom_access3 ; Yes, abort! 71 bra internal_eeprom_access3 ; Yes, abort!
72 72
73 rcall write_eeprom ; No, write one byte 73 rcall write_eeprom ; No, write one byte
74 call clear_LEDy 74 bcf LED_red
75 movff EEDATA,TXREG ; Send echo! 75 movff EEDATA,TXREG ; Send echo!
76 rcall rs232_wait_tx ; Wait for UART 76 rcall rs232_wait_tx ; Wait for UART
77 incfsz EEADR,F ; Do until EEADR rolls to zero 77 incfsz EEADR,F ; Do until EEADR rolls to zero
78 bra internal_eeprom_access2 78 bra internal_eeprom_access2
79 internal_eeprom_access2a: 79 internal_eeprom_access2a:
80 call clear_LEDusb ; LEDusb OFF 80 bcf LED_blue ; LEDusb OFF
81 bcf PIR1,RCIF ; clear flag 81 bcf PIR1,RCIF ; clear flag
82 bsf PIE1,RCIE ; re-enable interrupt for UART 82 bsf PIE1,RCIE ; re-enable interrupt for UART
83 clrf EEADRH ; Point to Bank0 again 83 clrf EEADRH ; Point to Bank0 again
84 bcf rs232_recieve_overflow ; Clear Flag 84 bcf rs232_recieve_overflow ; Clear Flag
85 bcf no_sensor_int ; Renable Sensor Interrupt 85 bcf no_sensor_int ; Renable Sensor Interrupt