[Reply is placed inline] On Wed, Aug 13, 2003 at 09:43:55PM -0400, Ken Pergola wrote: > Make an assumption regarding the DQ line and then test the assumption (see > code below): After reading the code, the comment makes sense to me. I like it, and thank you for it. Saves a little bit of processor time and saves space in the PICs memory. Woo! Back to coding I go! ;) > Also you will have an easier time with code maintenance if you do the > following: > #define CLK PORTA, 1 > #define DQ PORTA, 0 So THAT is how you define a bit level location!! That will make life MUCH easier! Thank you a lot for that tip, and thanks Andy. ;) > Andy Warren taught me this many years ago (thanks Andy!) > BCF CLK ; Bring CLK low > BSF DQ ; Assume DQ line will be a '1' > BTFSS ReadCmd,0 ; If bit 0 is clear, write a 0 to the > BCF DQ ; Assumption was wrong: force DQ line to 0 > BSF CLK ; Bring CLK high to tell temp. sensor > ; to read the next bit > DECFSZ BitCount,1 ; Decrement count of bits left to send > GOTO SendCmd ; If more bits need to be sent ... -- sabachka-piclist@oddmagic.net Logic: The art of being wrong with confidence... -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body