Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

osno

Member Since 06 Nov 2010
Offline Last Active Jan 05 2011 01:35 PM
-----

Posts I've Made

In Topic: Help needed with I2C EEPROM

04 January 2011 - 12:37 PM

One thing that bugs me, though, is the amount of repeated code in the xx16 and xx256 classes. If it where me, I'll make all the addresses an int, and then have an AddressByteCount property or something that will be 1 for the xx16 and 2 for the xx256, and have the base class handle the conversion (which is simply a loop making a >> 8 & 0xFF). All the Read and Write methods would be on the base class. Using that and the max address you can easily throw an exception if the address is wrong (which you already do anyway). Also, you can have all the overloads in the derived classes, but they'll look like this: public int WriteString(byte writeAddress, string value) { return WriteString((int)writeAddress, value); } You can even make the base class methods protected if you don't want users of the code to have the liability of an exception (except for the high byte of the xx256, where it will happen anyway). Anyway, thanks again!

In Topic: Help needed with I2C EEPROM

03 January 2011 - 11:00 PM

It took me quite a while to get back to my Netduino... and I must say that EEPROM code works amazingly well!! Thanks for that.

In Topic: Help needed with I2C EEPROM

07 December 2010 - 12:05 AM

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!!

In Topic: Help needed with I2C EEPROM

06 December 2010 - 06:18 PM

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.

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.

In Topic: Help needed with I2C EEPROM

27 November 2010 - 07:01 PM

Chris, any time frame on 4.1.1? CW2, is the version that's working with the EEPROMs the one that I have? Thanks, J

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.