??? 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. |