Shop OBEX P1 Docs P2 Docs Learn Events
microwire EEPROM — Parallax Forums

microwire EEPROM

Mike WMike W Posts: 105
edited 2007-08-25 17:10 in General Discussion
After reading through examples and text about EEPROM I made an attempt at a program to write and read from a ST M93C46 MICROWIRE serial access EEPROM.
I did not have much luck. I listed the program and a schematic of the part I have. The EEPROM is mounted to a small board and is configured for 16 bit operation.
If anyone could give me an idea where I am going wrong I would appreciate it.
Mike


Post Edited (Mike W) : 8/21/2007 5:42:24 PM GMT
992 x 573 - 55K

Comments

  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-08-17 15:42
    Mike,

    Can you give us more information? How have you tried to isolate the problem? Can you read anything from the chip even if it is not the correct value? When you wait for a write operation to complete does it seem to finish instantly, after a while, or never?

    I do not have experience with the EEPROM you are using and the problem was not readily apparent to me as I examined your program and drawing. If you can further isolate the cause of the problem it will be easier (and more likely) for someone to help you.

    - Sparks
  • Mike WMike W Posts: 105
    edited 2007-08-17 18:43
    Sparks
    Sorry for the lack of information.
    I mostly think that nothing is getting transmitted (op-codes, data) I did notice in the copy of my program I posted that I had deleted the % sign in front of the constant value. An accident it was always there.
    I have never got any read value except for 0, also the program hangs at my device_buisy loop while it is waiting for the write process to end. This is mostly why I do not think anything is happening now.
    ·
    The EEPROM is configured in 16 bit mode I would have to cut a trace and solder in a jumper to change it to 8 bit so I was trying to avoid that and try to get it to work the way it is.
    ·
    I have attached the latest version of the program and the data sheet for the M93C46 EEPROM
    ·
    I am mostly interested in comments and advice
    ·
    mike
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-08-17 21:57
    Mike,

    My understanding from page 7 of the datasheet is that the EWEN command must be issued for a specific address. Your code appears to send the EWEN command bits only without following them with an address.

    I have not looked for additional errors.

    - Sparks
  • Mike WMike W Posts: 105
    edited 2007-08-18 01:07
    Sparks

    now that you said that, ·I can see it that way.

    let me go at this some more.

    mike
  • Mike WMike W Posts: 105
    edited 2007-08-18 20:25
    well I changed the four subs I am using to include the address along with op-codes
    but still do not seem to be having any butter results.

    mike


    Post Edited (Mike W) : 8/21/2007 5:43:37 PM GMT
  • Mike WMike W Posts: 105
    edited 2007-08-21 17:43
    I deleted my first code to make the post shorter.
    ·
    ·
    I have tried every combination of op-code and address, I can think of. and I still don’t get any response/results. the program compiles and runs in debug but no data seems to be writer or read.
    I am not sure where I am going wrong
    Thanks to Sparks for his comments/support I hope my post is clearer now
    ·
    Anyhow I am still at a loss and would appreciate comments or suggestions as to where my code is flawed.
    ·
    Micro_Wire_X.sxb is my latest file and attached
    ·
    Thanks ·
    Mike W
  • Mike WMike W Posts: 105
    edited 2007-08-22 18:57
    two questions

    first, do I need to consider the one bit at a time rule or does shifout and shiftin take care of this with the \count parameter.

    second should I be using a ·pull up (or down) resistors·between my I/O pins on th SX and the I/O pins on the EEPROM.

    mike
  • Mike WMike W Posts: 105
    edited 2007-08-25 02:59
    well I have finally· got this thing to work.

    ·I had a few errors that I finally corrected and now things seem to work. My next hurdle is to figure out how to deal with the·with Hi byte and Lo byte variables that shiftin ends up with when it reads a 16 bit value

    Mike
  • BeanBean Posts: 8,129
    edited 2007-08-25 12:11
    Mike just postfix the WORD variable with "_MSB" and "_LSB" like so:

        SHIFTIN Serial_Output, Serial_Clock, MSBPOST, tmpW3_MSB \8  ' read the data data is msb first
        SHIFTIN Serial_Output, Serial_Clock, MSBPOST, tmpW3_LSB \8
    

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Teacher: What is the difference between ignorance and apathy ?
    Student: I don't know and I don't care
    Teacher: Correct !
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • Mike WMike W Posts: 105
    edited 2007-08-25 17:10
    thanks Bean

    the line of code I was not sure of was

    read_value = tmpW2_LSB, tmpW2_MSB

    thanks to all I have posted an updated file

    mike


    Post Edited (Mike W) : 8/26/2007 2:02:37 AM GMT
Sign In or Register to comment.