Mercurial > public > mk2
diff code_part1/OSTC_code_asm_part1/i2c_eeprom.asm @ 53:263348f83485
1.70 cleaning the code
author | heinrichsweikamp |
---|---|
date | Sat, 31 Jul 2010 10:25:59 +0200 |
parents | da553e5c7a90 |
children | 31fa973a70fd |
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/i2c_eeprom.asm Fri Jul 30 12:32:15 2010 +0200 +++ b/code_part1/OSTC_code_asm_part1/i2c_eeprom.asm Sat Jul 31 10:25:59 2010 +0200 @@ -333,33 +333,34 @@ bcf LED_red ostc_debug 'O' ; Sends debug-information to screen if debugmode active return -I2C_TX: - movwf i2c_temp2 ; Data byte - bsf SSPCON2,SEN ; Start condition - rcall WaitMSSP - movlw b'10010000' ; Bit0=0: WRITE, Bit0=1: READ - movwf SSPBUF ; control byte - rcall WaitMSSP - rcall I2C_WaitforACK - movff i2c_temp2, SSPBUF ; Data Byte - rcall WaitMSSP - rcall I2C_WaitforACK - bsf SSPCON2,PEN ; Stop condition - rcall WaitMSSP - return -I2C_RX: - bcf PIR1,SSPIF - bsf SSPCON2,SEN ; Start condition - rcall WaitMSSP - movlw b'10010001' ; Bit0=0: WRITE, Bit0=1: READ - movwf SSPBUF ; control byte - rcall WaitMSSP - rcall I2C_WaitforACK - bsf SSPCON2, RCEN ; Enable recieve mode - rcall WaitMSSP - movff SSPBUF,i2c_temp2 ; Data Byte - bsf SSPCON2,ACKEN ; Master acknowlegde - rcall WaitMSSP - bsf SSPCON2,PEN ; Stop condition - rcall WaitMSSP - return \ No newline at end of file + +;I2C_TX: +; movwf i2c_temp2 ; Data byte +; bsf SSPCON2,SEN ; Start condition +; rcall WaitMSSP +; movlw b'10010000' ; Bit0=0: WRITE, Bit0=1: READ +; movwf SSPBUF ; control byte +; rcall WaitMSSP +; rcall I2C_WaitforACK +; movff i2c_temp2, SSPBUF ; Data Byte +; rcall WaitMSSP +; rcall I2C_WaitforACK +; bsf SSPCON2,PEN ; Stop condition +; rcall WaitMSSP +; return +;I2C_RX: +; bcf PIR1,SSPIF +; bsf SSPCON2,SEN ; Start condition +; rcall WaitMSSP +; movlw b'10010001' ; Bit0=0: WRITE, Bit0=1: READ +; movwf SSPBUF ; control byte +; rcall WaitMSSP +; rcall I2C_WaitforACK +; bsf SSPCON2, RCEN ; Enable recieve mode +; rcall WaitMSSP +; movff SSPBUF,i2c_temp2 ; Data Byte +; bsf SSPCON2,ACKEN ; Master acknowlegde +; rcall WaitMSSP +; bsf SSPCON2,PEN ; Stop condition +; rcall WaitMSSP +; return \ No newline at end of file