??? 06/16/09 12:46 Read: times |
#166137 - So he has a long list of constraints Responding to: ???'s previous message |
1. He has to calculate the TH and TL according to his F_CPU
2. He has to have a timer ISR() and IRQs enabled 3. He can then read the current time, add his delay, and poll for this time to be reached. Taking account of overflows, missing ticks and atomicity of reads etc. compare this to: #include "delay.h" ... delay_us(50); // will be longer if IRQs are serviced ... delay_ms(1); ... and adding "delay.c" to his project. David. |