Andrew E. Kalman wrote: > Seriously, though, simplify your code on the way to a solution. Use > this instead: > > void main() > { > /* initialization code */ > > while (1) > { > PORTA ^= 0x10; > } > } Andrew: Personally, I think that's a bad suggestion. 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). Without that pullup, RA4 would always read low, so your code would just repeatedly write a 1 to the pin. With a too-weak pullup, your code would have the somewhat-interesting effect of auto-adapting his toggle frequency to the time-constant of his resistor... But that probably isn't what he wanted, and it would likely confuse him to see a very asymmetrical waveform with a frequency much lower than he expected. -Andy === Andrew Warren --- aiw@cypress.com === IPD Systems Engineering, CYSD === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body