This was a project I never intended! Originally, I just wanted to comment Anobium's code "24LCxxxx.h" just so I could learn more about I2C. As I eventually sorted it out, I noticed that it could be collapsed quite a bit, while adding to the generality. What evolved became different enough that I thought it might be best to give it a new name. But the original thrust is definitely Anobium's. You'll find the new include file attached to the next post. Here's what's new:
Beginners will find explanations in the file as well. It's self-documenting, but if you really want some sample programs using it, I'll be glad to pass them on.
I've tested this on the 24LC256 and AT24C32 which have page sizes of 64 and 32 bytes, respectively. I would surely appreciate it if others would test with other chips. The goal should eventually be to make this an all-inclusive package for I2C Eeproms, rather than have the Include folder keep exploding with all sorts of mini-files.
This is a revised posting to tell you where to get the latest file.
Please refer to here for the latest version of this file.
I will test and let you know.
What changed in terms of backwards compatibility? Backwards compatibility is very important as we change code.
I am porting the new GLCD routines to these new routines. Can you confirm the following is ok? I do not have time to test all these options. These were my test cases.
Array write of less than 64 bytes @ start of a page address+1
Array write of 65 bytes @ address 0
A quick response would be great.
I tested. Looks great. All ok on the latest include file.
During testing of the GLCD Image code I have found a little error where one of the parameters may not be passed correctly. I have corrected.
I have also added to references to call the same functions as strings.
We now have:
I have removed the variables that were defined. For some reason, I will figure out, if these variables were define then you cannot pass arrayelement(0) or a Constant as the length parameter.
Revised again but this time.... to support the hardware I2C module, the MSSP.
The same .h file supports the software and hardware I2C methods.
I have posted the latest file i2Ceeprom.h to the code section of SourceForge.
Just updated the front page of the CGB website with new of this driver.
Thanks Thomas Henry.
Here is a question.
Where does this go in the Help File?
Under EEPROM? or SERIAL? or elsewhere?
My vote would be for "elsewhere." In particular, anything that is devoted to specialized (external) hardware, and not in the low-level include file folder might be best as a separate category. For example, how about:
--- External Devices
- DS1307 Real Time Clock
- DS18S20 Thermometer
- Sony Remote Control
- I2C Eeproms
- DHT Humidity Sensors
- SRF04 Range Finder
In other words, anything that is not part of the normal innards of a PIC or AVR (timers, PWM. comparators, capture module, etc.) would be considered external and worthy of a separate category. Sort of like what the Arduino crowd does.
But perhaps the main thing would be to have multiple eyes proofread all the Help files for consistency, accuracy and eye-appeal to beginners. As I see it, that's the main stumbling block right now. There is no doubt in my mind that Great Cow Basic is the premier compiler for microcontrollers, but until we document it properly no one will ever know and it will languish.
Good idea. Will do.
I have started another thread on the Help file improvements.
Revised again - discovered another issue this week when working on another I2C issue.
I have added support to this library for Byte address EEPROMs. These are the smaller EEPROM devices that only require a BYTE address.
Same parameters as before simple choose a byte or word for the address parameter for the type of device.
Uploaded to the released code section of SourceForge, see https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/include/I2CEEPROM.h
I have updated header for copyright etc. This is now destined for general release. I will update the Help File as soon as practical.
Now supports writing Array and Strings to EEPROM, this version handles EEPROMs that required word or byte addresses, supports GCB Software IC2 and GCB Hardware IC2.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.