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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/25/11 09:26
Read: times


 
#182026 - OK
Responding to: ???'s previous message
Per Westermark said:
Trangga Findanugroho said:
Per Westermark said:
If you don't have any hardware for timing, then you need to count cycles.

The bad thing with cycle counting is that the counting will not include cycles spent on interrupts.

By the way - for some chips you might be able to send dummy characters to UART or SPI or similar as a way to measure time.



It works for me, Thaks a lot.

Sorry, but now I'm confused. Exactly what works for you? Counting cycles? Even when you do have a timer available that seems excellently suited for the task?




Well, actually I have project to make a HourMeter.
The problem is EEPROM is working to slow, so I must wait at least 10ms to store data properly.
That's why I need a delay routine to handle this case.
As you can see 89S51 only have two timers. I use Timer0 for ticking (1 Sec), and Timer1 is used for UART generator to interface beetween PC and MicController.


List of 17 messages in thread
TopicAuthorDate
How to Delay            01/01/70 00:00      
   Counting cycles            01/01/70 00:00      
      But *not* in a HLL            01/01/70 00:00      
         the problem with cycle counting ...            01/01/70 00:00      
      ok            01/01/70 00:00      
         ???            01/01/70 00:00      
            OK            01/01/70 00:00      
               So what do you do?            01/01/70 00:00      
               sounds crazy            01/01/70 00:00      
               again            01/01/70 00:00      
   Why *no*t using timers?            01/01/70 00:00      
      Why no timers....            01/01/70 00:00      
         "Software" Timers            01/01/70 00:00      
      for another delay            01/01/70 00:00      
         Bad answer            01/01/70 00:00      
         Why ignore replies?            01/01/70 00:00      
            Output-only mode            01/01/70 00:00      

Back to Subject List