microwire EEPROM
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
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
Comments
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
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
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
now that you said that, ·I can see it that way.
let me go at this some more.
mike
but still do not seem to be having any butter results.
mike
Post Edited (Mike W) : 8/21/2007 5:43:37 PM GMT
·
·
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
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
·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
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
·
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