Andy Warren notes: >Explicitly writing 1's and 0's, as Roy originally did, ensures that >he's not having a read-mofdify-write problem... Which he WOULD have >had if he used your code with his original hardware (i.e., without a >pullup on RA4). etc. All true -- I had not noticed that he was running at 20MHz, and at those speeds the pin behavior of the PIC, coupled with RMW, becomes an issue. In that case, better to do while (1) { imagePORTA ^= 0x40; PORTA = imagePORTA; } As an aside, though, does this code avoid the RMW issues? while (1) { PORTA |= 0x40; PORTA &= ~0x40; } Note that the HI-TECH compiler will use bcf and bsf instructions (just two instructions total in the loop), and so I don't see how the RMW issue crops up _with_respect_to_the_port_pin_in_question (PORTA[4])_. Other pins on the port may not behave as one expects ... Regards, -- ______________________________________ Andrew E. Kalman, Ph.D. aek@pumpkininc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body