??? 06/16/09 13:55 Read: times |
#166144 - oh boy what a load who wil have 10 minutes for this 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. 1) in your misapplied compiler 'example' the delay loop must be calculated as well 2) a bits and 4 lines of code 3) no atomiticty issue use a char, if a char is not enough then a counter in the non IST that is decremented when the ISR time flags 'done' Erik |