From: ceb Date: Mon, 7 Feb 2005 00:18:00 +0000 (+0000) Subject: i2c update X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=526af5a7617e8d900c8923947ef1300bb6e8e1f6;p=trains.git i2c update --- diff --git a/cebpic/i2c-test.asm b/cebpic/i2c-test.asm index 1b7f7ce..6afaf07 100644 --- a/cebpic/i2c-test.asm +++ b/cebpic/i2c-test.asm @@ -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