Yes it could be 1uSec / clock cycle @4MHZ... but not in Basic code, even in assembler @ 4MHZ, you couldn't do it @ 4MHZ with a software loop, hence why TIMERs are built in.
NOW, select a 16Bit timer that can be set as counter BY using the internal FOsc (ticks) and read the according register once in a while or in a loop. With some human measurement, you should be able to have a accuracy of few uSec.
This will also require you configure the Timer prescaler and pre-load value accordingly. To help you to figure out their value, i suggest you download my PicMutiCalc
http://www.mister-e.org/pages/utilitiespag.html
EDIT: it's sunday and my brain need to understand better what you need to do... i'm lost in your explanation. Maybe you could translate it to Mister E's poor english level?
Last edited by mister_e; - 29th April 2007 at 17:38.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks