??? 04/21/10 08:04 Read: times |
#175204 - Not *generally* true! Responding to: ???'s previous message |
Chris Papadopoulos said:
I have a delay routine, that gives my program a delay for 0,2 seconds. No, that is not generally true! That is true only with a certain specific crystal frequency, and processors that have identical numbers of cycles-per-instruction as the one that you used to determine this! If you want to make this a general routine to be shared among projects, you need to clearly document these dependencies! I want to have it in a separate .a51 file so i can add it in any project i want ...
What should be the beginning command in my delay routine so it can be called by my main program correctly? That will depend on which particular tools you are using - see the appropriate Manual(s) Where can i find the machine cycles of each command? The standard figures are in the so-called "bible" for the 8051 - links here: http://www.8052.com/faqs/120112 If you're using a processor with an "accelerated" core then, again, you will have to consult the specific documentation for that chip (or family) BTW: 200ms could be rather a long time to sit in a delay loop - you should consider whether a Timer would be more appropriate... |
Topic | Author | Date |
Delay routine | 01/01/70 00:00 | |
Not *generally* true! | 01/01/70 00:00 | |
Andy, did you mean | 01/01/70 00:00 | |
Something like that! | 01/01/70 00:00 | |
Busy loops sometimes ok | 01/01/70 00:00 |