??? 08/15/04 04:36 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#75935 - RE: Stuck on the event timer Responding to: ???'s previous message |
Glen:
It is my general comment that the way you are going about trying to measure how long something takes to perform in your microcontroller is too complex and will end up being imprecise due to interrupt overlays and latencies. When I need to measure the performance of a task, algorithm, or processing sequence on my microcontroller I make use of a spare I/O port pin. In the code where the measurement is meant to start I use a single SETB instruction to set the port pin to a high level. Likewise in the code path where measurement is intended to be completed I add in an single CLR instruction to set the port pin back to a low level. It is then possible to simply connect this pulse coming from the port pin into an oscilloscope, digital scope, or logic analyzer to measure its width. The technique is extremely easy to implement, leads to VERY accurate measurement and places very little overhead in the code paths being measured. Note that sometimes you have used up all the I/O pins for other functions and there is seemingly no spare available. In these cases it is often possible to "borrow" a pin from some other part of your system that is sitting idle during the time of interesting measurements. Michael Karas |
Topic | Author | Date |
Stuck on the event timer | 01/01/70 00:00 | |
RE: Stuck on the event timer | 01/01/70 00:00 | |
RE: Stuck on the event timer | 01/01/70 00:00 | |
RE: Stuck on the event timer | 01/01/70 00:00 | |
RE: Stuck on the event timer | 01/01/70 00:00 | |
RE: Stuck on the event timer | 01/01/70 00:00 | |
RE: Stuck on the event timer | 01/01/70 00:00 | |
RE: Stuck on the event timer![]() | 01/01/70 00:00 |