- Netduino Forums
- → osno's Content
osno's Content
There have been 17 items by osno (Search limited from 22-May 23)
#6976 Help needed with I2C EEPROM
Posted by osno on 04 January 2011 - 12:37 PM in General Discussion
#6941 Help needed with I2C EEPROM
Posted by osno on 03 January 2011 - 11:00 PM in General Discussion
#5833 Help needed with I2C EEPROM
Posted by osno on 07 December 2010 - 12:05 AM in General Discussion
So here is the class, fritzing diagram, and example output for the I2C EEPROM classes. There is also some extraneous code in the project for some MCP23008 and MCP23016 Digital I/O expander chips that I'm working on, so ignore those for now (they are a work-in-progress).
The example program should be relatively self-explanatory. Let me know if you've got questions or suggestions.
Very cool. It's actually similar to my first try. I'll have to try it in a week or so when I get home. Thanks!!
#5817 Help needed with I2C EEPROM
Posted by osno on 06 December 2010 - 06:18 PM in General Discussion
I'm interested . I'm away from home for a few days so I won't be able to provide feedback, but I sure would love to try when I get back.Not sure if you all are still interested, but I did get a class working for both a 24LC16B and a 24LC256 that uses the standard 4.1.0.5 firmware. It's only regular reads / writes, but I've had it write and read 10 consecutive bytes at a time without problem. I haven't tried (nor have a need for) random / sequential reads, so you're on your own for that.
If you are interested, I could post code and a fritzing diagram.
#5422 Help needed with I2C EEPROM
Posted by osno on 27 November 2010 - 07:01 PM in General Discussion
#5309 Help needed with I2C EEPROM
Posted by osno on 26 November 2010 - 02:23 AM in General Discussion
#5243 Help needed with I2C EEPROM
Posted by osno on 24 November 2010 - 11:42 AM in General Discussion
#4696 I2CDevice extension
Posted by osno on 08 November 2010 - 11:51 PM in Beta Firmware and Drivers
#4695 Help needed with I2C EEPROM
Posted by osno on 08 November 2010 - 11:49 PM in General Discussion
#4693 I2CDevice extension
Posted by osno on 08 November 2010 - 11:47 PM in Beta Firmware and Drivers
#4684 Help needed with I2C EEPROM
Posted by osno on 08 November 2010 - 11:07 PM in General Discussion
I think that after the Write, I should be sending the start again. Can I do that by doing this?
byte[] data = new byte[length]; using (I2CDevice eeprom = new I2CDevice(new I2CDevice.Configuration(0x50, 400))) //0x50 is 1010 000, 400 is 400khz { // Create a new Transaction I2CDevice.I2CTransaction[] transaction = new I2CDevice.I2CTransaction[]{ I2CDevice.CreateWriteTransaction(new byte[] { (byte)((address >> 8) & 0x7F), (byte)(address & 0xFF) }), }; eeprom.Execute(transaction, 1500); } using (I2CDevice eeprom = new I2CDevice(new I2CDevice.Configuration(0x50, 400))) //0x50 is 1010 000, 400 is 400khz { // Create a new Transaction I2CDevice.I2CTransaction[] transaction = new I2CDevice.I2CTransaction[]{ I2CDevice.CreateReadTransaction(data) }; int bytesTransfered = eeprom.Execute(transaction, 1500); if (bytesTransfered == length + 2) return data; else return null; }
Because I tried it, but it didn't work either...
I may be forced to reflash. I didn't want to brick my netduino .
Anyway, my problem. Thanks! I'll try that...
#4681 Help needed with I2C EEPROM
Posted by osno on 08 November 2010 - 10:26 PM in General Discussion
This is how I'm wiring everything. The digital pins are connected to a 74HC238 to show me some output from what I'm saving. I only drew a few leds... there's more. That part seems to work, though. The graphic:
And the code for the memory driver is:
public byte[] ReadBytes(ushort address, int length) { byte[] data = new byte[length]; using (I2CDevice eeprom = new I2CDevice(new I2CDevice.Configuration(0x50, 400))) //0x50 is 1010 000, 400 is 400khz { // Create a new Transaction I2CDevice.I2CTransaction[] transaction = new I2CDevice.I2CTransaction[]{ I2CDevice.CreateWriteTransaction(new byte[] { (byte)((address >> 8) & 0x7F), (byte)(address & 0xFF) }), I2CDevice.CreateReadTransaction(data) }; int bytesTransfered = eeprom.Execute(transaction, 1500); if (bytesTransfered == length + 2) return data; else return null; } } public void WriteBytes(ushort address, byte[] data) { using (I2CDevice eeprom = new I2CDevice(new I2CDevice.Configuration(0x50, 400))) //0x50 is 1010 000, 400 is 400khz { // Create a new Transaction I2CDevice.I2CTransaction[] transaction = new I2CDevice.I2CTransaction[]{ I2CDevice.CreateWriteTransaction(new byte[] { (byte)((address >> 8) & 0x7F), (byte)(address & 0xFF) }), I2CDevice.CreateWriteTransaction(data)}; // Execute the WriteBytes transaction, check if it was succesfull. int bytesTransfered = eeprom.Execute(transaction, 1500); } } }
The program does:
byte[] sequence = new byte[]{ 2, 1, 2, 3, 2, 1, 0, 3, 1, 2, 0 }; byte[] data = new byte[11]; board.Memory.WriteBytes(100, sequence); data = board.Memory.ReadBytes(100, 11);
And then loops flashing the leds.
Thanks in advance to any kind soul who can take a look and give me some advice. I have tried 2 different EEPROM chips (same type) to the same result. Many resistor/voltage combinations. Even reversing the SDA and SCL (that didn't help ). I don't know what to try at this point.
Thanks again,
J
(formatting tips are also appreciated... other people's posts look way better than mine!!)
#4554 Native code implementation
Posted by osno on 07 November 2010 - 01:11 AM in Netduino 2 (and Netduino 1)
#4549 Native code implementation
Posted by osno on 07 November 2010 - 12:49 AM in Netduino 2 (and Netduino 1)
#4546 Arduino and Netduino pros and cons
Posted by osno on 06 November 2010 - 10:13 PM in General Discussion
...
You can also look into using the bitbanger driver:
http://forums.netdui...tbanger-driver/
Does that give you a good start?
...
Looking into that right now. It looks promising! And thanks for the welcome and the response.
#4545 Native code implementation
Posted by osno on 06 November 2010 - 10:08 PM in Netduino 2 (and Netduino 1)
#4541 Arduino and Netduino pros and cons
Posted by osno on 06 November 2010 - 09:41 PM in General Discussion
- Netduino Forums
- → osno's Content
- Privacy Policy