| ??? 01/07/08 12:31 Read: times Msg Score: -1 -1 Answer is Wrong |
#149104 - What about a Delay like this. Responding to: ???'s previous message |
I have not tested this code. I just thru it together really fast.
but I hope you get the idea. My question is, would it work? void delay_t(unsigned int Delay)
{
TH1=0;
TL1=0;
while((int(TH1<<8)+int(TL1))<Delay);
}
void main(void)
{
TMOD=0x10;
TR1=1;
delay_t(100);
} |
| Topic | Author | Date |
| Number of CPU cycle for 8051 function call | 01/01/70 00:00 | |
| Do it in assembler | 01/01/70 00:00 | |
| Delay functions | 01/01/70 00:00 | |
| A related trick | 01/01/70 00:00 | |
| Offset | 01/01/70 00:00 | |
| Offset | 01/01/70 00:00 | |
| Sure | 01/01/70 00:00 | |
| Over Drive? | 01/01/70 00:00 | |
| a refinement | 01/01/70 00:00 | |
| NOPs are so bad waste of space... | 01/01/70 00:00 | |
| waste of space... waste of time | 01/01/70 00:00 | |
| fixed delay | 01/01/70 00:00 | |
| Variable delay | 01/01/70 00:00 | |
| determinism of the cache | 01/01/70 00:00 | |
| there are no cache misses in 'linear code' | 01/01/70 00:00 | |
| I got only ONE cache miss... | 01/01/70 00:00 | |
| Old Keil Thread | 01/01/70 00:00 | |
| What about a Delay like this. | 01/01/70 00:00 | |
| No, it won't. | 01/01/70 00:00 | |
| Ok. | 01/01/70 00:00 | |
| also | 01/01/70 00:00 | |
| Also ... | 01/01/70 00:00 | |
| Actually... | 01/01/70 00:00 | |
| will. | 01/01/70 00:00 | |
| ANSI C | 01/01/70 00:00 | |
Keil option: Disable ANSI casts | 01/01/70 00:00 | |
| typo. | 01/01/70 00:00 |



