Using 2 EEPROM's with propeller.
DavidM
Posts: 630
HI,
I would like to use 2 EEPROM's with the propeller. ( this is for salable production)
EEPROM-1, As the normal EEPROM for spin code
EEPROM-2, As extra memory to store a unique SERIAL NO , parameters and some user data ( not much under 1-2k)
I understand these are both on the I2C bus, I also have a LCD display that is using the same I2C bus.
Q1) When I load spin code to the eeprom ( via spin) , does the propeller IGNORE the second eprom?
Q2) Do I just parallel wire these as normal? ( i.e SCL, SDA wired in parallel)
The reason I want to do this is to update firmware and not have to worry about the serial no and user settings/data.
Q3) Is this a valid approach?
I believe I can get small EEPROM's quite cheap.
regards
Dave M
I would like to use 2 EEPROM's with the propeller. ( this is for salable production)
EEPROM-1, As the normal EEPROM for spin code
EEPROM-2, As extra memory to store a unique SERIAL NO , parameters and some user data ( not much under 1-2k)
I understand these are both on the I2C bus, I also have a LCD display that is using the same I2C bus.
Q1) When I load spin code to the eeprom ( via spin) , does the propeller IGNORE the second eprom?
Q2) Do I just parallel wire these as normal? ( i.e SCL, SDA wired in parallel)
The reason I want to do this is to update firmware and not have to worry about the serial no and user settings/data.
Q3) Is this a valid approach?
I believe I can get small EEPROM's quite cheap.
regards
Dave M
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
I was think of just using one of these 24LC04B from microchip for under a dollar! And I need to use the I2C bus.
I am not sure of the chip you are suggesting?
Dave M
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Although I've not done any of this personally; I believe the answer to all of your questions is yes!
Leon & Nick also have valid approaches; probably the simplest is to use a bigger EEPROM - that'd be the same as what's done on the ProtoBoard, which has 64K. I'm sure there are several objects that will enable use of bigger EEPROM (as well as multiple EEPROMs).
HTH.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style
yes I can use a bigger eeprom, But once I administer a serial number I don't want to loose it , and I need to change the firmware if needed, I would expect to have hundreds of EEPROM's to update, I would have to manage the uploading of the spin to the propeller and make sure it does not write over the serial /user data. I also dont know how large my program is going to be yet!
To me, it would be easier to use two eeproms.
Thanks
Dave M
So long as your data / S/N, etc are above 32K it should remain - even after re-programming.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style
You have a valid point! So I gather that 32K is the maximum that spin can use for a program?, I mean can I still address more than 32K with data?
Dave M
As I understand it; the IDE downloads the full 32K - whether your program uses it all or not (I'm sure someone'll correct me if I'm wrong!). So, as long as your non-volatile data is written above the first 32K it will remain.
<edit>
Just to clarify; your program will need to use one of the I2C objects to put the non-volatile data above 32K. I don't think there's any way to get it there otherwise...
</edit>
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style
I think I will just use 1 EEPROM!
regards
Dave M
I was wondering how different I2c devices get their address, I gather its done with pins?
thanks
Dave M
pdf1.alldatasheet.com/datasheet-pdf/view/74858/MICROCHIP/24LC256.html
In the first page you se that pins 1,2 and 3 correspond to the addresses A0, A1 and A3. The base address for this device can be seen in page 6 of the same datasheet, and how it is formet (0xa0 + A3A2A1b).
I hope is clear (ask if not). Some I2C devices does not have extra pins for addresses so you have to have one bus per device.
Have fun
Dave M
A bit more complicated to make things easier.
Different devices have different base-addresses (cast in silicon). Sometimes, the address can be selected with a different part-number (especially if it doesn't have address-pins).
So having more than one device on I2C, it is best to watch out for conflicts in the addresses (and maybe set a different address with the pins and/or the part).
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO