Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/17/06 05:21
Read: times


 
#116346 - Some points
Responding to: ???'s previous message
Vu Nhu Khanh said:
i'm trying to make a controller for cable winding machine,the controller uses AT89S52 and a 24W04 serial eeprom i've also fit in a 10 keys key board to input numbers, and five seven segments led, my controller is expected to do these things:

- upon startup if power to the motor driver (a stepper motor) is connected the controller read data from seeprom and begin operate, it will drive the motor till the number of pulse from it's encoder (20 pulse per motor turn) equals data read from seeprom, then motor stops waiting for a pulse from cable's drum sensor (one pulse per turn) upon detecting this pulse it read another two byte from seeprom and begin the cycle till all data from seeprom are read.

-upon startup if power not apply to motor driver it enters setup, it first read two byte from keypad and if save button pressed
save these byte in seeprom in consecutive order,every time user pushed next then save the sequence repeats.

When power applied to motor driver the controller ends programming task and begin operation

my keypad and all other button worked, read and display encoder as well as compare routine worked fine except seeprom read and write routine do not work or read wrong .I've included the code listing written in assembly. Please help me to find out my mistakes


(I'm a foreigner so my English might not be clear or concise! hope you don't mind my English.) this is my first time using seeprom.
Thanks alot
Vu Nhu Khanh
I've include the file listing so you can help me



Ok, you did very well in posting... I offer this:

1) It seems that all that is not working is the write or read operation to your SEEPROM. I suggest you strip down your code to input/output (keypad/display) and serial eeprom write/read routines (problem area). This way, the other routines are not a distraction to debugging.

2) Write a short main code to:
Input a value
Write the value
Read and display the value


3) Repost just your source code and not the assembler output (list file) using the (pre) and (/pre) tags to (pre)serve formatting... this will make it easier to read. Just the SEEPROM routines would probably be all you need to show, providing you are sure the other routines are working perfectly.

4) Post a link to the datasheet of the SEEPROM you are using.

If you're not sure how to post your code using the pre /pre tags refer to http://www.8052.com/users/jonled/noob.pdf

Jon





List of 8 messages in thread
TopicAuthorDate
incremental read or write to seeprom            01/01/70 00:00      
   Some points            01/01/70 00:00      
   Good post!            01/01/70 00:00      
      I second that. Neither we nor you ...            01/01/70 00:00      
         Often a bug can be found            01/01/70 00:00      
            elaborating            01/01/70 00:00      
         Some delay could help            01/01/70 00:00      
      Thanks you all            01/01/70 00:00      

Back to Subject List