In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote: Hi Devin; I don't have the book or code in front of me but I suspect the answer goes as follows: mov w, >> rc reads a shifted copy of the ADC alternating input and output lines..... we are only interested in those that were the inputs. not w flips all pins that were read, so those inputs that were high will now be low, and those that were low will now be represented high in the w register. The ADC program requires that if an input reads high, its associated output must be driven low, and vice versa. and w,#%0101_0000 eliminates all except the outupt pins. or port_buf,w merges the new output state into a register which may have other non-ADC outputs in it. mov rc, port_buf refreshes the output pins to the desired condition. Hope that helps. Cheers, Peter (pjv) ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=341240#m344251 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)