You have the address configured as device 5. PortD.6 is SDA, PortD.5 is SCL. Is that correct? I always use 4.7K pullups on the I2C lines too. You might try making them a little less stiff.
You have the address configured as device 5. PortD.6 is SDA, PortD.5 is SCL. Is that correct? I always use 4.7K pullups on the I2C lines too. You might try making them a little less stiff.
Last edited by circuitpro; - 11th December 2009 at 02:32.
Suggest you check:
1. 4.7k pull-ups not 2.2k - may not make any difference but will elliminate a possibility. I know 10k pull-ups work at low speed but not 40MHz.
2. Address you are using is: 101, are the chip pins set accordingly?
3. A 512k EEPROM must have a word size address, is XX definately a word size variable?
4. Is the write-protect pin grounded to enable writing?
Regards Bill Legge
I tried 10K pull-ups (no joy) and my program scanned all the addresses.
For X = 0 to 7
Address = $A0 + (X<<1)
...
The internal device address ("command") was definitely a WORD variable.
But I *DID* find something very interesting: Whenever the MSb (A2) of the EEPROM was brought high, the device stopped responding. Addresses $A0,$A2,$A4,$A6 all worked. $A8,$AA,$AC and $AE didn't. This happened on two separate devices (both were Microchip 24FC512's from the same lot).
Tomorrow AM, I'll find out more.
And for those playing with I2C, I found out the hard way that if you invoke DEFINE I2C_HOLD 1 and something holds SCL low (like a remote device with a diode clamp to ITS Vcc and it loses power), there is no timeout. Your program hangs forever. An email to MELABS support got me a quick answer (from a familiar person). Solution: if you are using the HOLD option, test for SCL HIGH before you invoke any I2CWRITE command.
Charles Linquist
CL,
What is a 'MCC I2C analyzer?'
Regards Bill Legge
CL,
Thanks - I've had a look at the site/product - a bit pricey for me as only an occasional/hobby I2C user. The Australian magazine 'Silicon Chip' had an I2C analysis board as a do-it-yourself project about a year ago. It used pretty mendane chips and some free Phillips software; I must give it a go.
Can you run your system at 10MHz and see if that does the trick?
Please let us know when/if you get it going. I spent ages getting familiar with EEPROM I2C and would like to learn what the problem was.
Regards Bill legge
Hey Charles,
If you are still having trouble try changing EEADR to %10100000 and to tie A0,A1, and A2 on the eeprom chip to ground.
If that does not work then try it with and without the I2C_slow setting.
Dave
Always wear safety glasses while programming.
Bookmarks