On Monday 15 October 2001 12:19 pm, Fok, Ben wrote: > Hi folks: > > What is the easiest way to toggle an I/O line without know what the state > of the line is? > > I hate to use a bit test state with a bunch of goto statement. I thought > about using the > xor instruction but can't get it to work. What code did you try for the XOR? Remember that if you read a PIC I/O port that is set as an output, you will read the actual logic state there, not necessarily what you set it to last. So if you're loading it down so far that its output voltage is less than the input "one" threshold, you will see it as false. In these cases, you'll have to maintain a separate RAM location with the desired state of the output port. -- Ned Konz currently: Stanwood, WA email: ned@bike-nomad.com homepage: http://bike-nomad.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics