??? 12/28/04 05:54 Read: times |
#83963 - another alternative Responding to: ???'s previous message |
i was just reading the posts and the suggestion that Timer1 can be used in 16 bit auto reload mode. so here is another way that i can keep track of precise timings.
In initialization mode of the software - configure timer1 for 16 bit auto reload mode - set the timer1 to count for 50ms's. - set timer1 running. In the main while(1) loop for the software while(1) { <main program here> if(TF1 == 1) { TF1 = 0; zzz++; if(zzz == 20) { seconds++; zzz = 0; } } } as you can see that there is no interrupt being occured so no interrupt latency. Timer1 is set in 50 or 100ms count loop and it go on counting. if it overflows it sets the TF1 to 1 and rload and counting. in the mean while the program in while(1) loop keeps track of over flows and sets TF1 = 0 and also manage the seconds. I am sure that during 50 or 100ms the code in while(1) loop will executes many times. I feel that there is nothing to worry about the latency in this scheme. so need you guys views on this. and let me know if still there is any change that some delays will be introduced. Shahzad Aslam |
Topic | Author | Date |
Interrupt latency calculation | 01/01/70 00:00 | |
Constant = variable | 01/01/70 00:00 | |
Yes that's correct | 01/01/70 00:00 | |
16-bit auto-reload | 01/01/70 00:00 | |
Performance Analyzer | 01/01/70 00:00 | |
Accuracy, thats the question | 01/01/70 00:00 | |
accuracy | 01/01/70 00:00 | |
A bad order | 01/01/70 00:00 | |
another alternative | 01/01/70 00:00 | |
correction Timer2 not Timer1 | 01/01/70 00:00 | |
Timer2![]() | 01/01/70 00:00 |