aboutsummaryrefslogtreecommitdiffstats
path: root/i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'i2c.c')
-rwxr-xr-xi2c.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/i2c.c b/i2c.c
index 5b3b707..04dcda1 100755
--- a/i2c.c
+++ b/i2c.c
@@ -12,8 +12,12 @@ void I2C_Master_Init(const unsigned long freq_K) //Begin IIC as master
SSPCON = 0b00101000; //pg84/234
SSPCON2 = 0b00000000; //pg85/234
- SSPADD = (_XTAL_FREQ/(4*freq_K*100))-1; //Setting Clock Speed pg99/234
- SSPSTAT = 0b00000000; //pg83/234
+ //SSPADD = (_XTAL_FREQ/(4*freq_K*100))-1; //Setting Clock Speed pg99/234
+ SSPADD = 49;
+
+ //SSPSTAT: SMP:CKE:D/!A:P:S:R/!W/:U:BF *U unimplemented read as 0
+ SMP = 1; // Disable slew rate
+ CKP = 0; // Data transmitted on rising edge of SCK
}
void I2C_Master_Wait()