Adding 24LC256 EEPROM to Javelin?
Hi,
I would like to add a 24LC256 EEPROM to my Javelin. Look like it will require 2 pin (One data, one clock), and will need to setup the EEPROM address, so seems that it's possible to make it work.
I'm fine with the protocol between the Javelin and the EEPROM, but I have 3 concerns/questions.
1) It requires a clock. So should I use the same kind of code as what is used for DS1620?
2) It requires a "Start condition" (A high-to-low transition of the SDA line while the clock (SCL) is high) and a "Stop condition" (A low-to-high transition of the SDA line, while the clock(SCL) is high). How can I generate those conditions? Is it the same thing as START_CONVERT in DS1620 code? Or is it simply always generated by the shiftOut/shiftIn methodes?
3) Acknowledges. Should I manage them manually? Can I ignore them? (Each receiving device, when addressed, is obliged to
generate an Acknowledge signal after the reception of each byte. The master device must generate an extra clock pulse which is associated with this Acknowledge bit.)
For point 2, I think that the "mode" parameter of the (expletive)In method will do that, but I'm not sure.
Or maybe 24LC256 just can't be used with Javalin externaly? Since Javelin is already using this component, is there a way to use native methodes?
Thanks for your help,
Jean-Marc
I would like to add a 24LC256 EEPROM to my Javelin. Look like it will require 2 pin (One data, one clock), and will need to setup the EEPROM address, so seems that it's possible to make it work.
I'm fine with the protocol between the Javelin and the EEPROM, but I have 3 concerns/questions.
1) It requires a clock. So should I use the same kind of code as what is used for DS1620?
2) It requires a "Start condition" (A high-to-low transition of the SDA line while the clock (SCL) is high) and a "Stop condition" (A low-to-high transition of the SDA line, while the clock(SCL) is high). How can I generate those conditions? Is it the same thing as START_CONVERT in DS1620 code? Or is it simply always generated by the shiftOut/shiftIn methodes?
3) Acknowledges. Should I manage them manually? Can I ignore them? (Each receiving device, when addressed, is obliged to
generate an Acknowledge signal after the reception of each byte. The master device must generate an extra clock pulse which is associated with this Acknowledge bit.)
For point 2, I think that the "mode" parameter of the (expletive)In method will do that, but I'm not sure.
Or maybe 24LC256 just can't be used with Javalin externaly? Since Javelin is already using this component, is there a way to use native methodes?
Thanks for your help,
Jean-Marc
Comments
http://www.parallax.com/tabid/430/Default.aspx
Download application note AN005
regards peter
·
You're amazing! You always have a solution for pretty everything!
Thanks A LOT!
Jean-Marc
PS: There is a not about Roomba, but I'm not able to find the related link.
I have download and implement the class you suggested, but I still have some troubles.
I have connected Vcc to Vdd, the clock to pin3, the data to pin2 and the rest to Vss. I have try with this configuration, and also with a 10K resistor between Data and Vdd. Do in any case, it doesn't come back from i2c.start(); in the write method.
I'm initializating like: MC24LC256 eeprom = new MC24LC256 (CPU.pin2, CPU.pin3);
And writing like: MC24LC256.writeOne(0, 0, (byte)23);
The code is so simple that I don't think it can be wrong. Do you have any clue of where the issue is?
Thanks,
Jean-Marc
regards peter
Again, thanks a lot! I'm now able to read and write to the 24LC256! Next step, add 8 EEPROMs to my Javelin (even if I don't really need so much memory, but that's coooool)
Regards,
JM