RMW is Read-Modify-Write. The bit set and bit clear instructions work by reading the whole port, modifying the bit you are setting or clearing, then writing the whole port back out again. The RMW problem is a problem when you do a few bit sets or clear immediately after writing to a port. Due to capacitive loading on the port pins, it takes time for the line to go high or low. If you wrote it high, then read it before it goes high, modify another bit, then write the modified value back out again, that line that you had written high but had not yet had a chance to go high will now be low (since that's how it was read). Shadow registers are bytes of RAM where you do the bit set and clear instructions on this byte of RAM, then copy the RAM to the port. You end up doing the RMW on the RAM, which changes very quickly, unlike a port line. As someone else has pointed out, if you are using an 18 series part, you can avoid the RMW problem by doing all your outputs (such as bit set and clear) to the LAT register instead of the PORT register. The RMW of the LAT reads the output latch instead of the output pin, so it doesn't matter if the pin has not yet changed to the correct level. Hope I made sense! Harold > Wouter, > > I like to know what is RMW? and shadow register? > > thanks in advance > > Andre > > > > > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf > Of Gerhard Fiedler > Sent: Tuesday, January 02, 2007 2:43 PM > To: piclist@mit.edu > Subject: Re: [EE] logic component connection limit > > > Wouter van Ooijen wrote: > >>> I had terrible r-m-w problems driving several 74HC gates due to >>> the collected capacitance of inputs and wiring. As well as the nops >>> found a 1k loading resistor for the PIC pin helped >> >> If you have RMW problems there is only one real cure: use a shadow >> register. > > FWIW, the OP says he is using the 18F4520. Shouldn't have RMW problems at > all... > > Gerhard > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist