I wonder if anyone can offer any suggestions?.
I'm playing with the I2C hardware on a PIC24FJ64GA002 using the I2C code from http://www.engscope.com/pic24-tutorial/10-2-i2c-basic-functions/ along with a tutorial board I've built containing a FRAM and an I2C expansion socket, I'm using 10K pullups. With just the FRAM connected it all works fine, the test program simply reads four bytes at a time from the FRAM, displays them via RS232, and also lists all devices found on the bus - in this case just 0xA0.
This is a cut and paste of it working:
0xD5, 0x00, 0xD8, 0x01
Addresses on I2C - 0xA0
If I power it down and plug another device in the expansion port (I've got I2C LCD boards, and DS3231/DS1307 clocks) then it doesn't work at all, the four bytes read as zeros, and it lists 128 I2C addresses - there's also no activity on the I2C bus according to my scope.
If instead of powering it down I simply insert the extra device (with it still powered up), it works perfectly - and I can even display data on the LCD display, and here's the RS232 data:
0xD5, 0x00, 0xCF, 0xFD
Addresses on I2C - 0x7E, 0xA0
The FRAM data bytes have been updated to the next four, and the I2C LCD adaptor address has been added at 0x7e.
Likewise, adding a DS3231 gives:
0xDA, 0xFA, 0xD7, 0xF9
Addresses on I2C - 0xA0, 0xAE, 0xD0
The DS addresses of 0xAE and 0xD0 have been added.
I can even add both:
0xDD, 0xF9, 0xDF, 0xF7
Addresses on I2C - 0x7E, 0xA0, 0xAE, 0xD0
So any clues as to why it won't power up and work with other devices attached?.
I'm playing with the I2C hardware on a PIC24FJ64GA002 using the I2C code from http://www.engscope.com/pic24-tutorial/10-2-i2c-basic-functions/ along with a tutorial board I've built containing a FRAM and an I2C expansion socket, I'm using 10K pullups. With just the FRAM connected it all works fine, the test program simply reads four bytes at a time from the FRAM, displays them via RS232, and also lists all devices found on the bus - in this case just 0xA0.
This is a cut and paste of it working:
0xD5, 0x00, 0xD8, 0x01
Addresses on I2C - 0xA0
If I power it down and plug another device in the expansion port (I've got I2C LCD boards, and DS3231/DS1307 clocks) then it doesn't work at all, the four bytes read as zeros, and it lists 128 I2C addresses - there's also no activity on the I2C bus according to my scope.
If instead of powering it down I simply insert the extra device (with it still powered up), it works perfectly - and I can even display data on the LCD display, and here's the RS232 data:
0xD5, 0x00, 0xCF, 0xFD
Addresses on I2C - 0x7E, 0xA0
The FRAM data bytes have been updated to the next four, and the I2C LCD adaptor address has been added at 0x7e.
Likewise, adding a DS3231 gives:
0xDA, 0xFA, 0xD7, 0xF9
Addresses on I2C - 0xA0, 0xAE, 0xD0
The DS addresses of 0xAE and 0xD0 have been added.
I can even add both:
0xDD, 0xF9, 0xDF, 0xF7
Addresses on I2C - 0x7E, 0xA0, 0xAE, 0xD0
So any clues as to why it won't power up and work with other devices attached?.