Using Multiple EEPROMs


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    1. What is the proper setup for multiple chips ; %1010x01x ?? or what?
    I use the 24FC512 because you can have up to 8 devices on the same bus.
    The 515 is a bit different,
    I'll have a look at the datasheet and get back to you later

    2. Are the external eeproms physically tied on pins A0 and A1 to set their address?
    The answer is: YES

    3. Do they all share the same bus lines?
    The answer is: YES

    4. What is the PBP command setup for dealing with multiple units? Does my program logic deal with EACH CHIP, or does PBP make both of them into one big memory bank, and I don't have to worry about the two units?
    You can only access one physical chip at a time by specifying it's address with I2CWRITE / I2CREAD

    5. If Do have to worry about the two units then I need to be intelligent about using one up, then jumping to the other, then remembering where I put things when I go to get them back.... Right?
    You would need some pointer anyway to memorize which location you have last written to.

    Have a look at this thread
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  2. #2
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Thumbs up

    THANKS MUCH!!

    I am glad I was on the right track. Do you know of any higher density memory that can be used like this? I'd really like 2-4m per chip if it existed, was easy to write to using PBP, and was not to horribly expensive..

    Tom

  3. #3
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Exclamation Sending but no data comes back from Ext. EEPROM

    OK - I have the EEPROMS setup per what has been described, and we can compile and it LOOKS like it sends data to the chips, but I cant' see anything coming back.. I read in 1000 values from 0 to 999 in an 'x' loop, then read them back, and all I see are '0's... Help! I think my naming of the chips is wrong..

    Chip is an 16F876A.

    I have two chips 24LC515 512k .. I have given them names:

    DPIN var PortA.2 ' I2C data
    CPIN var PortA.1 ' I2C clock
    address var byte
    value var byte

    Chip1 con %10100000 ' address of chip1
    Chip2 con %10100100 ' address of chip2

    Init:
    PORTA = %00000 'Initialize PortA to all zeros - all output
    TRISA = %00000 'All port A output
    PORTB = %00000101 'Initialize PortB - port 2 for data, port 0 for button interrupt
    TRISB = %00000101 'Port 2 inputs are 0 and 2
    T1CON = %01000000 'Timer1 1:1 prescale(?). Timer1 off
    ----------------------------------------------------------------------

    I read and write to them like this: For this demo I only will write 1000 records in each chip.


    storedata:
    for x = 0 to 1000
    i2cwrite dpin,cpin,chip1,x,x
    pause 10
    serout2 Apinout, 16468, [I,CLR]
    serout2 Apinout, 16468, [I,L1_C1]
    serout2 Apinout, 16468, ["Writing: C1 ",#x]
    Next x

    for x = 0 to 1000
    i2cwrite dpin,cpin,chip2,x,x
    pause 10
    serout2 Apinout, 16468, [I,CLR]
    serout2 Apinout, 16468, [I,L1_C1]
    serout2 Apinout, 16468, ["Writing: C2 ",#x]
    Next x

    ...
    ...
    Readitback:
    ' read memory contents to screen.
    serout2 Apinout, 16468, [I,CLR]
    serout2 Apinout, 16468,[I,L1_C1]
    Serout2 AGPSout, 16572, ["Memory Dump Chip 1: ", 10,13]
    Address =0
    p=0
    x=0
    For p = 1 to 29 ' total sentences storable in memory
    serout2 AGPSout, 16572, ["SS ",#p,": "]
    for address = X to (X+34)
    I2Cread Dpin,Cpin,Chip1, address, value
    serout2 AGPSout, 16572, [",",#value]
    next address
    serout2 AGPSout, 16572, [10,13]
    X=X+34
    next p

    serout2 Apinout, 16468, [I,CLR]
    serout2 Apinout, 16468,[I,L1_C1]
    Serout2 AGPSout, 16572, ["Memory Dump Chip 2: ", 10,13]
    Address =0
    p=0
    x=0
    For p = 1 to 29 ' total sentences storable in 1k
    serout2 AGPSout, 16572, ["SS ",#p,": "]
    for address = X to (X+34)
    I2Cread Dpin,Cpin,Chip2, address, value
    serout2 AGPSout, 16572, [",",#value]
    next address
    serout2 AGPSout, 16572, [10,13]
    X=X+34
    next p

    Return

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    fast overlook... did you read caefully your EEPROM datasheet??? Try to use a WORD sized variable for your address.. also look how many bits must be shift for address + control word and how.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Thumbs up

    Working now... It was simply a mis-wired A2 pin. With everything neatly in place, resistors in line, etc. We have both chips working fine. I was also off in the chip 2 definitin by a bit. Now it works great. Thanks for the help!

    Chip1 con %10100000 ' address of chip1
    Chip2 con %10100010 ' address of chip2

    TG

Similar Threads

  1. Multiple PICS from Same Crystal?
    By WOZZY-2010 in forum General
    Replies: 2
    Last Post: - 6th February 2010, 15:18
  2. Multiple RETURNS within a single subroutine
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st June 2009, 16:43
  3. Multiple EEPROM 24LC
    By alik in forum General
    Replies: 3
    Last Post: - 4th February 2008, 10:24
  4. Problems controlling multiple pics
    By gandora in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 29th May 2007, 08:59
  5. Multiple PIC's with 1 crystal
    By puma in forum Schematics
    Replies: 11
    Last Post: - 20th March 2007, 17:02

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts