Well, there's certainly more questions about I2C than answers. Since no one seems to know how to do this, I will continue informing the list of my progress. I finally got some DS275's, so I substitued one for the MAX232 just to make sure those charge pumps weren't screwing with me again. No improvement, however, other than 5 fewer caps on my board :-) So I decided I'd done enough homework and called Microchip. At first they said, oh, yeah, sure, you just need PICDEM2.ZIP. Well, it is technically an example of I2C, but it's mostly bit banging; it certainly isn't code for master mode on the 877, tho. So then they admitted they are working on an AN and will try to get the code to me. uhu, sure... > It's a bad day when I'm replying to my own messages... > > I tried de-coupling caps on the EEPROM. I put huge 40ms delays after every I2C > bus access. And I put a scope on the SDA and SCL. SCL had a rock solid pulse at > 385kHz, just like I calculated. Big grin on that one. And SDA had 1's and 0's all > over the place. I also tried 1K pullups instead of 2K, and 33pf caps on the bus > lines, but I still can't get anything out that looks like what I put in. > > > Greg Hartung wrote: > > > No problem, Mike, any input is welcome. > > I found one eroneous line in the code. I moved the clrf SSPSTAT that was > > after the switch to Bank 0 to before the switch because SSPSTAT in bank 1. > > Will I ever learn? > > I also tried a value of 49 for a clock of 100kHz. And I also tried > > commenting out the SSPCON2 inits. And I even tried changing the slew rate for > > the 100kHz test. The output was still the same rotated pattern of grouped 1's > > no matter what I did. The 100kHz did slow the output down quite a bit, which > > was encouraging. > > Pleeeeeeease someone help me. > > I am foolishly thinking of putting the scope on it, but I dunno what to look > > for. Those timing charts in the datasheet hurt my head. > > Does anybody know how I might read the I2C with some other device to try and > > narrow down if I'm having read or write problems? > > I also noticed the original author had a stop bit before the second start > > bit in the i2c_read proc, but the 24lc256 datasheet does not indicate that it > > should be there. > > I have 2k pullups and no caps on SCL and SDA. Should I try decoupling caps > > on power again? (Can't believe I just thought of that... not the brightest > > lad sometimes...) >