Shop OBEX P1 Docs P2 Docs Learn Events
EEPROM question help — Parallax Forums

EEPROM question help

ArchiverArchiver Posts: 46,084
edited 2002-12-02 22:56 in General Discussion
I am trying to use a Xicor EEPROM x25650 in place of the
x25640. I am using the code in the parallax EPROM appkit but
can't get it to work. The code loads and runs but returns a value of "0". I
looked at the Xicor data sheets for both EPROM's and
can see no significant difference. has anyone had experience using the x25650?
Any help would be greatly appreciated!!

LF


[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-11-28 08:37
    Hi Lawrence

    I am using the X25650 too. For my applications I wrote the code you
    find
    below.
    You would have to assign proper pin number values to
    SEEcs1,SEEcs2,SEEclk
    and
    SEEssio. Note: I use one single pin (SEEssio) to read and write to
    the EEPROM
    - the output pin is connected to the input pin through a 1k resistor.


    BS2
    +
    in
    ssio ! 1k
    +---/\/
    out

    Then you use the subroutines in the following order:

    SEEaddr = your-address
    SEEdata = your-data-byte
    gosub SEEwren 'write enable
    gosub SEEwb 'write a byte
    ...
    gosub SEErb 'read a byte
    get-your-byte-from SEEdata

    Adrian


    'module_SEE.bs2
    '{$STAMP BS2}

    '

    ' Module SEE
    ' Serial EEPROM (SEE) routines.
    '
    ' usage:
    ' gosub SEEwren write enable
    ' gosub SEEwb write byte SSEdata to SSEaddr
    ' gosub SEEwrdi write protect
    ' gosub SEErb read byte SSEdata from SSEaddr
    ' gosub SEErstat read status byte to SSEstat (overwrites SSEdata)
    '


    SEEcs1 con 0'MCSp1..9 'chip 1 select\
    SEEcs2 con 0'MCSp1..9 'chip 2 select\
    SEEclk con 0'MCSclk 'clock
    SEEssio con 0'MCSssio 'sync. serial IO

    SEEcs var nib 'chip select
    SEEaddr var word 'address
    SEEdata var byte 'data
    SEEstat var SEEdata 'status byte, alias
    SEEbusy var SEEstat.BIT0 'busy bit, alias

    '

    ' SEEwb write byte
    '

    SEEwb:
    low SEEcs
    shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]2]
    shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]SEEaddr\16]
    shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]SEEdata]
    high SEEcs
    return

    '

    ' SEErb read byte
    '

    SEErb:
    low SEEcs
    shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]3]
    shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]SEEaddr\16]
    shiftin SEEssio,SEEclk,MSBPRE,[noparse][[/noparse]SEEdata]
    high SEEcs
    return

    '

    ' SEErstat read status byte
    '

    SEErstat:
    low SEEcs
    shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]5]
    shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]SEEaddr\16]
    shiftin SEEssio,SEEclk,MSBPRE,[noparse][[/noparse]SEEstat]
    high SEEcs
    return

    '

    ' SSEwren write enable
    '

    SEEwren:
    low SEEcs
    shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]6]
    high SEEcs
    return

    '

    ' SSEwrdi write disable
    '

    SEEwrdi:
    low SEEcs
    shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]4]
    high SEEcs
    return
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-29 15:00
    Thanks Adrian, I added my data elements, loaded the program but came up with
    the same result "seedate=0" I suspect that the IC is bad. Can you suggest a
    source of supply.

    Larry

    Original Message
    From: "Adrian Schneider" <adrian.schneider@t...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, November 28, 2002 3:37 AM
    Subject: [noparse][[/noparse]basicstamps] Re: EEPROM question help


    > Hi Lawrence
    >
    > I am using the X25650 too. For my applications I wrote the code you
    > find
    > below.
    > You would have to assign proper pin number values to
    > SEEcs1,SEEcs2,SEEclk
    > and
    > SEEssio. Note: I use one single pin (SEEssio) to read and write to
    > the EEPROM
    > - the output pin is connected to the input pin through a 1k resistor.
    >
    >
    > BS2
    +
    in
    > ssio ! 1k
    > +---/\/
    out
    >
    > Then you use the subroutines in the following order:
    >
    > SEEaddr = your-address
    > SEEdata = your-data-byte
    > gosub SEEwren 'write enable
    > gosub SEEwb 'write a byte
    > ...
    > gosub SEErb 'read a byte
    > get-your-byte-from SEEdata
    >
    > Adrian
    >
    >
    > 'module_SEE.bs2
    > '{$STAMP BS2}
    >
    > '
    >
    > ' Module SEE
    > ' Serial EEPROM (SEE) routines.
    > '
    > ' usage:
    > ' gosub SEEwren write enable
    > ' gosub SEEwb write byte SSEdata to SSEaddr
    > ' gosub SEEwrdi write protect
    > ' gosub SEErb read byte SSEdata from SSEaddr
    > ' gosub SEErstat read status byte to SSEstat (overwrites SSEdata)
    > '
    >
    >
    > SEEcs1 con 0'MCSp1..9 'chip 1 select\
    > SEEcs2 con 0'MCSp1..9 'chip 2 select\
    > SEEclk con 0'MCSclk 'clock
    > SEEssio con 0'MCSssio 'sync. serial IO
    >
    > SEEcs var nib 'chip select
    > SEEaddr var word 'address
    > SEEdata var byte 'data
    > SEEstat var SEEdata 'status byte, alias
    > SEEbusy var SEEstat.BIT0 'busy bit, alias
    >
    > '
    >
    > ' SEEwb write byte
    > '
    >
    > SEEwb:
    > low SEEcs
    > shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]2]
    > shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]SEEaddr\16]
    > shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]SEEdata]
    > high SEEcs
    > return
    >
    > '
    >
    > ' SEErb read byte
    > '
    >
    > SEErb:
    > low SEEcs
    > shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]3]
    > shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]SEEaddr\16]
    > shiftin SEEssio,SEEclk,MSBPRE,[noparse][[/noparse]SEEdata]
    > high SEEcs
    > return
    >
    > '
    >
    > ' SEErstat read status byte
    > '
    >
    > SEErstat:
    > low SEEcs
    > shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]5]
    > shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]SEEaddr\16]
    > shiftin SEEssio,SEEclk,MSBPRE,[noparse][[/noparse]SEEstat]
    > high SEEcs
    > return
    >
    > '
    >
    > ' SSEwren write enable
    > '
    >
    > SEEwren:
    > low SEEcs
    > shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]6]
    > high SEEcs
    > return
    >
    > '
    >
    > ' SSEwrdi write disable
    > '
    >
    > SEEwrdi:
    > low SEEcs
    > shiftout SEEssio,SEEclk,MSBFIRST,[noparse][[/noparse]4]
    > high SEEcs
    > return
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-12-02 15:49
    just to be sure about this - did you hook up the -HOLD and -WP
    pins of the 25650 to +5V and did you provide the bypass cap?
  • ArchiverArchiver Posts: 46,084
    edited 2002-12-02 22:56
    Adrian,

    I connected the EEPROM as shown in the Parallax AppKit information. 5V to
    hold and WP and I used the cap as indicated in the drawing. The EEPROM I
    am using came along with some other stuff I ordered from Parallax more than
    a year ago. I didn't order it and assumed it was part of a promotion that
    Parallax was running. It came with the resistor and cap. It has been laying
    in my parts box for a while. I must have accidentally zapped it. I have
    ordered another and will give it another try.

    Larry

    Original Message
    From: "Adrian Schneider" <adrian.schneider@t...>
    To: <basicstamps@yahoogroups.com>
    Sent: Monday, December 02, 2002 10:49 AM
    Subject: [noparse][[/noparse]basicstamps] Re: EEPROM question help


    > just to be sure about this - did you hook up the -HOLD and -WP
    > pins of the 25650 to +5V and did you provide the bypass cap?
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
Sign In or Register to comment.