??? 08/06/06 10:02 Read: times |
#121721 - Asking the impossible! Responding to: ???'s previous message |
I'm not sure why the program sample you've shown us is inconsistant with the delay. There may be other issues like hardware problems. As for calculating the EXACT delay using 'c' - that's a difficult question. One of the things you give up when using a compiler is the fine control of the instructions. For a given compiler with a given piece of code, you can calculate the delay by looking at the instructions the compiler generates BUT change compiler and anything else, then your delay is not guaranteed. Best to use a timer for timing or call an assembler routine. Also, its good practice to put in the braces {} for your for-next loops just to make the code a bit more readable. See misra-c www.misra.org.uk. |