ADC without additional components in spin.
Hi everybody,
I'm a 1st year student working on a project using the stingray robot.
My job is to get the Qti Line follower (#28108) to work on the Propeller Robot Control Board, MSR1 (28230) without the use of any extra components like the ADC083. Resistors,capacitors and diodes are allowed though.
The propeller manual says that it should be possible using the counters, to bad it doesn't say wich one..
I have searched the a lot on google and this forum but couldn't find any examples. Obex doesn't seem to have an object in for spin either.
The only solutions i have found were written for BS or used additional components, except for the AN001 doc, but that didn't cleared things up for me..
Does someone have any experience with the Qti line follower in spin?
It would help me out a lot!
Thanks in advance.
I'm a 1st year student working on a project using the stingray robot.
My job is to get the Qti Line follower (#28108) to work on the Propeller Robot Control Board, MSR1 (28230) without the use of any extra components like the ADC083. Resistors,capacitors and diodes are allowed though.
The propeller manual says that it should be possible using the counters, to bad it doesn't say wich one..
I have searched the a lot on google and this forum but couldn't find any examples. Obex doesn't seem to have an object in for spin either.
The only solutions i have found were written for BS or used additional components, except for the AN001 doc, but that didn't cleared things up for me..
Does someone have any experience with the Qti line follower in spin?
It would help me out a lot!
Thanks in advance.
Comments
pub readpot(p) '' Reads RC circuit on pin p '' -- takes about 2ms '' -- assumes 10K + 0.01uF ctra := (%01000 << 26) | p ' ctra in pos detect mode frqa := 1 outa[p] := 1 ' charge cap dira[p] := 1 waitcnt((clkfreq >> 10) + cnt) ' ~1ms @100MHz phsa := 0 ' clear counter dira[p] := 0 ' allow discharge repeat while (ina[p] == 1) ctra := 0 ' disable ctra return (phsa >> 4) <# 500 ' return discharge time
Note, too, that for my application of scrub off the lower four bits and truncate the value at 500.