Subversion Repositories Code-Repo

Rev

Rev 113 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 113 Rev 114
Line 36... Line 36...
36
 
36
 
37
    SSPSTAT = 0x0;
37
    SSPSTAT = 0x0;
38
    SSPCON1 = 0x0;
38
    SSPCON1 = 0x0;
39
    SSPCON2 = 0x0;
39
    SSPCON2 = 0x0;
40
    SSPCON1bits.SSPM = 0x8; // I2C Master Mode
40
    SSPCON1bits.SSPM = 0x8; // I2C Master Mode
-
 
41
 
-
 
42
    /* SSPADD = (( Fosc/bit rate) / 4 ) - 1 */
-
 
43
#ifdef _REMOTE
41
    SSPADD = 0x63;          // Operate at 100KHz (40MHz)
44
    SSPADD = 0x63;          // Operate at 100KHz (40MHz)
-
 
45
#endif
-
 
46
#ifdef _BASE_STATION
-
 
47
    SSPADD = 0x4F;          // Operate at 100KHz (32MHz)
-
 
48
#endif
-
 
49
    
42
    SSPSTATbits.SMP = 1;    // Disable Slew Rate Control
50
    SSPSTATbits.SMP = 1;    // Disable Slew Rate Control
43
    SSPCON1bits.SSPEN = 1;  // Enable MSSP Module
51
    SSPCON1bits.SSPEN = 1;  // Enable MSSP Module
44
}
52
}
45
 
53
 
46
// Sends length number of bytes in msg to specified address (no R/W bit)
54
// Sends length number of bytes in msg to specified address (no R/W bit)