bigmik Guru Joined: 20/06/2011 Location: AustraliaPosts: 2979
Posted: 01:55am 16 Mar 2012
Hi Rob,
Using Geoff's example on the DuinoMite you will need to use Pins 5,6 or 7 as the count input as he has quote Maximite Pin No.s so where he quote pin 13 you need to replace it with one of the others as here
SOUND 100000, 3600000 ' 100KHz for a long time (1 hour)
SETPIN 5,5 ' set pin 13 as a counting input
...
PRINT PIN(5) ' get the count
...
PRINT PIN(5) ' count should have incremented
You will also need to use line numbers,
Hmm, On second thoughts, Maybe all of the above depends on which firmware you are using... If DM firmware (olimex) then what I said above is correct, if using Geoffs 12 pin MM firmware then what Geoff said is correct (I assume pins 10,11,12,13 are the count inputs on Geoff's DM version of MM 3.x)..
Now, depending on exactly what you mean to do 10us is very fast... each basic instruction, I believe, takes 30uS to process so doing something with 10uS accuracy is going to difficult come impossible.