On Mon, 27 Jan 2003, =C5ke Neehr wrote: *>Hello! *> *>I=B4m using portb 0-6 on a Pic 16F84 to drive *>a LED-display and I want to use portb 7 *>to control a transistor with but my displayloop *>set the port to zero every time! *> *>Is there any good trick to sole this out? Make a variable to hold the state of the RB7 (transistor off or on), call it Foutput_mirror. Then use it in the LED display code like this: Instead of movwf PORTB ; output display use andlw RB7MASK ; clear the 7th bit iorwf Foutput_mirror,w ; mask in the transistor control movwf PORTB ; output display and transistor ; define this mask (before you use it) RB7MASK EQU b'01111111' ; mask the highest bit Then elsewhere in your program: turn on transistor: bsf Foutput_mirror,7 turn off: bcf Foutput_mirror,7 then call the display routine and it will be output. You can also output it directly. bye, Peter -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads