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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/16/09 11:20
Read: times


 
#166131 - Go on. Suggest a SIMPLE alternative
Responding to: ???'s previous message
Mahesh,

Perhaps you can suggest a suitable function / macro that will be easy for Sandeep to use.

I think we can safely assume that Sandeep is quite happy to have a blocking function. I also think it quite acceptable to pass a F_CPU that takes account of any clocking differences. e.g a 12MHz xtal with x2 clock = 24MHz.

So if you can write a library function that will save the state of a Timer, do the blocking delay, and restore the Timer to its original configuration and with a correct time. Please elaborate.

The alternative is to write a program to flash an LED every 10 seconds using Murray's delay function.

Sandeep counts the the flashes with a stopwatch and applies the relevant calibration for the delay function.

Or even just uses the simulator to do the calibration.

He can now use an accurate delay function to his heart's content.
The job is now done until Sandeep buys a new C compiler.

David.

List of 30 messages in thread
TopicAuthorDate
s/w delay function            01/01/70 00:00      
   Software loops can be optimized away            01/01/70 00:00      
   lacks side-effects            01/01/70 00:00      
      First time with LINT?            01/01/70 00:00      
   lacks side-effects            01/01/70 00:00      
      That does not mean it is an error.            01/01/70 00:00      
      It also blocks            01/01/70 00:00      
   How to post legible source code            01/01/70 00:00      
   DELAY_0.1.ZIP Useful?            01/01/70 00:00      
      That doesn't help, and it won't work anyhow!            01/01/70 00:00      
         I stand by it.            01/01/70 00:00      
            Yes a delay function is useful            01/01/70 00:00      
               wrong !!!!            01/01/70 00:00      
               No, that's precisely where you're wrong            01/01/70 00:00      
            How can you say that?            01/01/70 00:00      
               I think you should read Murray's comments            01/01/70 00:00      
                  I have seen ...            01/01/70 00:00      
                     Timers usable without start/stop too            01/01/70 00:00      
                        free-running counter/timer            01/01/70 00:00      
                           Unsigned integers            01/01/70 00:00      
                              re: unsigned            01/01/70 00:00      
                                 Try unsigned subtraction with borrow            01/01/70 00:00      
                                 bug in second (improved!?) code block            01/01/70 00:00      
   Delay Loops in 'C'..!!! NO            01/01/70 00:00      
      Go on. Suggest a SIMPLE alternative            01/01/70 00:00      
         My Methods            01/01/70 00:00      
            So he has a long list of constraints            01/01/70 00:00      
               oh boy what a load who wil have 10 minutes for this            01/01/70 00:00      
                  Ok. I was being naughty.            01/01/70 00:00      
                     you forget the obvious ...            01/01/70 00:00      

Back to Subject List