Great!
Since you are using 10-bit resolution, you only need to pause ~188mS.
Yes, it's still "<-- My favorite".
And it's probably best to release the pin instead of driving it low after the conversion.
Code:high DQ pause 188 input DQ
Great!
Since you are using 10-bit resolution, you only need to pause ~188mS.
Yes, it's still "<-- My favorite".
And it's probably best to release the pin instead of driving it low after the conversion.
Code:high DQ pause 188 input DQ
Last edited by Darrel Taylor; - 29th November 2011 at 03:42.
DT
I changed the wait to 188 - tested ok
I was not aware that INPUT pin# was a way to release the pin and I kind of felt unsure as to why I set it low, I guess it was a psychological way of undoing the high.
Anyways looking in the PBP bible 5.41 it says that using TRISB.5 = 1 is a more efficient way, not sure if it is just because it is faster to write when setting all pins to input at once.
I figured not using anything might be even more efficient so I just removed the last line altogether and the reading is still good.
So do you think leaving it out is ok or is there a chance it might create issues?
Mike
It does say that, doesn't it?
Well, it's not entirely correct.
It would be more efficient than the first example in the manual INPUT 0, because it has to figure out what pin 0 refers to.
But there is no difference at all between INPUT PORTB.5 and TRISB.5 = 1. They both generate the exact same code.
That should be OK too.I figured not using anything might be even more efficient so I just removed the last line altogether and the reading is still good.
So do you think leaving it out is ok or is there a chance it might create issues?
The following OW commands will control the TRIS bit and leave it in INPUT mode when it's finished.
DT
Excellent!
Thank you Darrel.
Mike
Bookmarks