piclist 2003\02\18\153602a >
Thread: Pin won't turn off properly
picon face BY : Stephen Holland email (remove spam text)

I ran Jinx's code on an oscilloscope, and I could only see correct results
when using code exactly as David has provided.

The read-modify-write issue is a common one, especially with the setb clrb
instructions. It makes perfect sense once you understand that bit-wise
instructoins such as setb and clrb are actually nothing more than the
sequence of read-or-write or read-and-write. If these instructions are not
followed by nops, then if you look at the pipeline to see when reads and
writes actually occur, you will see the problem clearly. Simply, the port
does not yet have what you expecting when the next instruction's read
occurs. Using back to back setb or clrb instructions on different port pins
is fine, but not on hte same port.


{Quote hidden}

Protect your PC - get McAfee.com VirusScan Online

http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

See also: www.piclist.com/techref/ubicom/devices.htm?key=sx
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Pin won't turn off properly

month overview.

new search...