aboutsummaryrefslogtreecommitdiffstats
path: root/i2c.c
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2019-08-07 18:46:23 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2019-08-07 18:46:23 -0500
commitb3b3ddcc15879c61719285321e2033eef248f9be (patch)
tree189c05fc11672270c6934771a91d6871cf2cbe45 /i2c.c
parentf0b60214163c8d69e9faf22abe5fd72a3628342d (diff)
Break out SSPSTAT configuration for SMP and CKP and set SSPADD to a decimal number instead of a formula.
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()