JT_ 0 Posted October 25, 2007 Report Share Posted October 25, 2007 I think the SSP Mode Select bits are setup incorrectly in the McFarlam's Picdem 2 + demo code. These are bits 3-0 in SSPCON1. #ifdef _PIC16 sspcon = 00101000b; // 16F877 has the same register, it's just labelled differently. #else sspcon1 = 00101001b; // Enable the serial port and configures the SDA and SCL pins as the serial port pins #endif // I2C Master mode, clock = FOSC/(4 * (SSPADD + 1)), clock polarity == 0. According to the comments on the last line in the above code, the first 4 bits of sspcon1 should be 1000 and not 1001. Indeed, the temperature sensor demo works only with sspcon1 = 00101000b. (As per the PIC18FXX2 datasheet). This means the only difference between 16F and 18F452 here should be the labeling of the register. The same is true for the 18F4520, which is what I'm running. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.