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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/29/02 15:23
Read: times


 
#33450 - RE: delay code help!
When you code up your delay routine you need to make sure to add the number of NOP instructions inside the loops that correspond to the numbers in $D$7 -> $D$9 of the spreadsheet. Also enter the frequency in Hz into $C$5. If you have a standard type 8051 with the instruction at XTAL/12 then you put the 12 in cell $F$5. If another higher performance part with different divider like 6 or 4 or 3 or 1 then enter that into $F$5 instead.

It is a good idea to fiddle with the values N and the three "nop" counts with an entry A value of 1 so that the delay is as close as possible to the delay resolution you desire. For example, if you wanted 1 msec resolution then if the values are picked corectly then the value in A when you call the subroutine is the number of milliseconds of delay (for up to 255 milliseconds since A is a byte value on the 8051). For the 1 msec exanple I set the spreadsheet to:
Freq=12000000
Divider=12
InnerNOP=7
OuterNOP=1
OnceNOP=0
N=110
Entry A=1
-----------
This gives delay == 1 millisecond (1/1000 th second).

Michael


List of 9 messages in thread
TopicAuthorDate
delay code help!            01/01/70 00:00      
RE: delay code help!            01/01/70 00:00      
RE: delay code help!            01/01/70 00:00      
RE: delay code help!            01/01/70 00:00      
RE: delay code help!            01/01/70 00:00      
RE: delay code help!            01/01/70 00:00      
RE: delay code help!            01/01/70 00:00      
RE: delay code help!            01/01/70 00:00      
RE: delay code help!            01/01/70 00:00      

Back to Subject List