dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 28 February 2006, 0:32 AM Post subject: |
|
|
Perhaps not as simply as with the Rabbit but you can do some timing. Depending on the duration of the instructions being timed you may be able to use Register.RTCStopWatch which has a resolution of 1.95mS. The nice thing about this register is that you can set it to zero and then read it later to determine the elapsed time without having to deal with RTC roll over.
If you need higher resolution, you can program Timer1 to get a resolution as low as 67.8nS. If you take that route, however, you'll have to avoid using the several System Library routines that need to use Timer1.
You can also get higher resolution by using Register.TCNT0 in conjunction with Register.RTCFastTick. Register.TCNT0 changes at the rate of 230.4KHz and rolls over from 224 to zero 1024 times per second. Each time it rolls over, Register.RTCFastTick is incremented and every two times, Register.RTCTick is incremented. |
|