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

1.60 stable rc1
author heinrichsweikamp
date Wed, 21 Apr 2010 17:37:30 +0200
parents 96a35aeda5f2
children da553e5c7a90
comparison
equal deleted inserted replaced
20:8824446f7241 21:73014f788032
280 rcall I2CFail 280 rcall I2CFail
281 return 281 return
282 282
283 I2CFail: 283 I2CFail:
284 ostc_debug 'M' ; Sends debug-information to screen if debugmode active 284 ostc_debug 'M' ; Sends debug-information to screen if debugmode active
285 call set_LEDy 285 bsf LED_red
286 rcall I2CReset ; I2C Reset 286 rcall I2CReset ; I2C Reset
287 bcf PIR1,SSPIF 287 bcf PIR1,SSPIF
288 clrf i2c_temp 288 clrf i2c_temp
289 return 289 return
290 290
328 movwf SSPCON1 328 movwf SSPCON1
329 movlw b'00000000' 329 movlw b'00000000'
330 movwf SSPCON2 330 movwf SSPCON2
331 movlw d'8' ; 400kHz I2C clock @ 16MHz Fcy 331 movlw d'8' ; 400kHz I2C clock @ 16MHz Fcy
332 movwf SSPADD 332 movwf SSPADD
333 call clear_LEDy 333 bcf LED_red
334 ostc_debug 'O' ; Sends debug-information to screen if debugmode active 334 ostc_debug 'O' ; Sends debug-information to screen if debugmode active
335 return 335 return
336 I2C_TX: 336 I2C_TX:
337 movwf i2c_temp2 ; Data byte 337 movwf i2c_temp2 ; Data byte
338 bsf SSPCON2,SEN ; Start condition 338 bsf SSPCON2,SEN ; Start condition