Shop OBEX P1 Docs P2 Docs Learn Events
Using 2 EEPROM's with propeller. — Parallax Forums

Using 2 EEPROM's with propeller.

DavidMDavidM Posts: 630
edited 2007-11-13 13:12 in Propeller 1
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

Comments

  • LeonLeon Posts: 7,620
    edited 2007-11-13 09:53
    You could also use one of those little Dallas 1-wire devices.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • DavidMDavidM Posts: 630
    edited 2007-11-13 09:58
    Hi Leon,

    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 MuellerNick Mueller Posts: 815
    edited 2007-11-13 09:58
    Or just a bigger EEPROM?

    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • simonlsimonl Posts: 866
    edited 2007-11-13 10:03
    Hi David,

    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 smile.gif
  • DavidMDavidM Posts: 630
    edited 2007-11-13 10:04
    Hi Nick,

    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
  • simonlsimonl Posts: 866
    edited 2007-11-13 10:05
    David,

    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 smile.gif
  • DavidMDavidM Posts: 630
    edited 2007-11-13 10:08
    Hi Simoni,

    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
  • simonlsimonl Posts: 866
    edited 2007-11-13 10:25
    Yup, you can access the EEPROM above 32K - not sure if there's a limit to how far you can go, but 64K is definitely doable [noparse]:)[/noparse]

    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 smile.gif
  • DavidMDavidM Posts: 630
    edited 2007-11-13 10:35
    Thanks Simoni,

    I think I will just use 1 EEPROM!


    regards

    Dave M
  • AleAle Posts: 2,363
    edited 2007-11-13 11:06
    most I2C devices have extra pins to change the address. The propeller will read the device with a specific address (external A0..2 = 0), if you use the address 001b for te second EE, that will make it not active when the propeller reads the address 000b, as you would expect.
  • DavidMDavidM Posts: 630
    edited 2007-11-13 11:26
    HI Ale,

    I was wondering how different I2c devices get their address, I gather its done with pins?


    thanks

    Dave M
  • AleAle Posts: 2,363
    edited 2007-11-13 11:44
    If they are the same part number, they have a specific address and sometimes pins to select low weight address. Have a look at the 24lc256 datasheet:
    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
  • DavidMDavidM Posts: 630
    edited 2007-11-13 11:48
    Thanks Ale


    Dave M
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-11-13 12:11
    > Some I2C devices does not have extra pins for addresses so you have to have one bus per device.

    A bit more complicated to make things easier. smile.gif
    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
  • AleAle Posts: 2,363
    edited 2007-11-13 13:12
    Ja Nick, you are right I forgot about the variations in part numbers, I think Microchip's I/O expanders are of this kind, or where ADCs ?, fuzzy memory of mine now smile.gif
Sign In or Register to comment.