On Sat, 10 Jan 2004 14:21:00 +0100, Jan-Erik Svderholm XA (TN/PAC) wrote: >Hi. >I don't remember what PIC you are using, but... > >On the 18-series you can write to the LATx regsiters >instead of the PORTx registers. This should avoid some >of these problems. I'd guess that what you are writing >about is the read-before-write problems when using >the bit handling instructions on port registers, where >the read part will read whatever the pin is driven to by >some external source, right ? > >The LATx regs in the 18-series solves this problem. > On the 16-series devices, so does avoiding the use of bit set/clear operations on ports by rolling your own read-modify-write operation. Reading the whole port in, modifying W as you need to, and then writing the whole thing back works well in situations like this. :=) While the bsf and bsf opcodes certainly *can* be used on ports, they're not the only (nor sometimes the best) way to change port bits. Regards, Bob -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body