On Fri, 8 May 1998 10:10:01 +0100 Sabananthan Paramananthan writes: >Hi, > >I've had lot more trouble with PORTA of PIC16C73A/JW. I used RA4:RA0 >of >PORTA as test out puts and RA5 as a jumper pin which is pull-up to 5V >via >resistor. When I set 1 of the bits or clear one of the bits (bsf, bcf) >all >other bits which were set are now cleared! Be sure to configure these pins for digital service with the ADCON register. When set for analog, they will still function as digital outputs by clearing the TRIS bits, but the PORTA register will always read zero on these pins. Thus the bsf/bcf operations will misbehave as you describe. It is still good practice to do only writes to the port by saving an image in RAM as you have. Heavy DC or capacitive loads on the port pins can cause them to read improperly. If your hardware allows, the extra instructions to copy RAM to port can be minimized by not updating the port after changing each bit. For example, turning LEDs on and off can wait until the top of the main loop. At that time, the RAM image would be copied to the port, changing all bits at once. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]