chiark / gitweb /
i2c update
authorceb <ceb>
Mon, 7 Feb 2005 00:18:00 +0000 (00:18 +0000)
committerceb <ceb>
Mon, 7 Feb 2005 00:18:00 +0000 (00:18 +0000)
cebpic/i2c-test.asm

index 1b7f7cec7c63a20a484686b3508d95b6d352ea65..6afaf071da6e4e19af03ff92effcba4787141cbb 100644 (file)
@@ -154,8 +154,18 @@ initialise
 
 ; i2c setup
 
+; NB to generate an address, take PIC_NO bits 4-0 and prepend 10
+; (i.e. all addresses are of the form 10xxxxx)
+
        movlb   I2C_BUFF_PAGE   ; ser BSR=i2c BSR (4)
 
+common_setup
+
+
+
+
+master_or_slave
+
        btfss   I2C_CTRL,I2C_MASTER,1   ; test whether PIC is master
        goto    pic_master_setup        ; if so, set up as master
        goto    pic_slave_setup         ; else set up as slave