Subversion Repositories Code-Repo

Compare Revisions

Ignore whitespace Rev 113 → Rev 114

/Classwork/ECE4534 - Embedded Systems/PIC 26J11/i2c.c
38,7 → 38,15
SSPCON1 = 0x0;
SSPCON2 = 0x0;
SSPCON1bits.SSPM = 0x8; // I2C Master Mode
 
/* SSPADD = (( Fosc/bit rate) / 4 ) - 1 */
#ifdef _REMOTE
SSPADD = 0x63; // Operate at 100KHz (40MHz)
#endif
#ifdef _BASE_STATION
SSPADD = 0x4F; // Operate at 100KHz (32MHz)
#endif
SSPSTATbits.SMP = 1; // Disable Slew Rate Control
SSPCON1bits.SSPEN = 1; // Enable MSSP Module
}