summaryrefslogtreecommitdiff
path: root/software/ihu/i2c.inc
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2013-06-28 02:50:41 +0000
committerChristian Pointner <equinox@mur.at>2013-06-28 02:50:41 +0000
commitc5f3e07f41ebc8fc81b30c1ce2b27ab853f178f1 (patch)
tree0228af59e4e846d373206d499b69f7f1ab3bcb29 /software/ihu/i2c.inc
parentihu and rtc work now (diff)
improved i2c_init
git-svn-id: https://svn.spreadspace.org/mur.sat@795 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/ihu/i2c.inc')
-rw-r--r--software/ihu/i2c.inc12
1 files changed, 4 insertions, 8 deletions
diff --git a/software/ihu/i2c.inc b/software/ihu/i2c.inc
index bbd424f..072d01d 100644
--- a/software/ihu/i2c.inc
+++ b/software/ihu/i2c.inc
@@ -30,15 +30,11 @@
;; -------------------------------------
i2c_init
- bsf STATUS,RP0 ; make them outputs first
- bcf I2C_SDA ; every write access is read-update-write
- bcf I2C_SCL ; therefore the second bcf SDA sets SCL again
- bcf STATUS,RP0 ; because of the external pull-up
- bcf I2C_SCL
- bcf I2C_SDA
+ movlw I2C_MASK ; as every write access is read-update-write this needs
+ andwf I2C_PORT,f ; to be done in one step (external pull-ups!)
bsf STATUS,RP0
- bsf I2C_SDA
- bsf I2C_SCL
+ movlw ~I2C_MASK
+ iorwf I2C_PORT,f
bcf STATUS,RP0
return