> Good morning/day Jinx. > And good day to you > After you put byte into port you are making bsf manipulation. > In reality PIC _is_ reading port value than modify the bit than > writes it back to port. In your example modified data is stored > exactly in port itself. I mistakenly "thought" that mov instructions are r-m-w but bsf/bcf aren't. It says in the manual that "All write operations are r-m-w. So a write to a port implies that that the port pins are first read, then this value is modified and written to the port latch". I'm aware of the bsf-nop-bcf of course and use that in my own s/w and so shouldn't have made such an erroneous statement The btfsc instructions between the bsf instructions should be enough to avoid a bad r-m-w situation with LEDs > What I was saying that depending from load situation or delays > because of capacitance if you write "0"/"1" you probably won't > get it back two cycles later for say on 20MHz clocking. That's certainly something to watch out for, perhaps more so in analogue circuits. Digital interfaces should be alright shouldn't they ? Are you thinking of an instance where you'd drive a logic chip with one pin and expect to see a result on another ? > > I stepped onto this trouble couple times in the past. After that > if I doubt a little bit I better use shadow register technique. > All manipulations are performed under some memory cells > than that value is copied to requied port That's a sensible thing to do. Is r-m-w a peculiarity of the PIC ? The AVR, for example, is quite different. There's no mention of r-m-w with regard to any port operation. In fact you can perform two distinct reads of a port - you can either read the latches or use the PIN instruction to read the logical values present on the pins -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body