Steve Kasm wrote: > > Hi All, > > Apparently if you have an interrupt on the tmr0 overflow active, in my > case this interrupt is updating the data in a 4511 and driving 4 > transistors for a 4 digit LED display, then outputs on the PortB will > not latch when the interrupt is running. By disabling the interrupt and > blanking my display in code I was able to get the portb,5 port to latch > it's output for my purpose. > > I guess you learn something everyday. > > Thanks all for your help Your interrupt is probably overwriting the data on PORTB,5 causing it to be reset to 0. When you write the digit data to PORTB are you preserving the RB5 data bit. For example, if you know RB5 is high (Relay = On) and you also want RB0 to go high then you must write b'00100001' to PORTB. If RB5 is low (Relay = Off) then you must write b'00000001' to PORTB. You can have a Shadow register to do this task. Shadow_B At the start of the code clrf PORTB clrf Shadow_B ; = same as PORTB In the Interrupt routine, say setting RB0... bsf Shadow_B,0 movf Shadow_B,W movwf PORTB In the MainLoop code, say turning on the relay bsf Shadow_B,Relay movf Shadow_B,W movwf PORTB If the Interrupt routine executes every 5mS or so to keep the displays refreshed, then all the MainLoop code has to do is.. bsf Shadow_B,Relay The Interrupt will update PORTB from the Shadow_B register. -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body