Ok. Now I am using the PIC16CE624 to monitor 8 data lines by software polling. Memory location called Result is used to store the states of the I/O pins with a special condition. In any event say data line 2 is toggled from a low to a high, bit 2 of Result will be toggle to a '1'. Upon a key press from the PC, the data in Result will be transferred via RS232 to the PC and displayed on the VB terminal. Pull-up resistors are activiated and a logic '0' on the pin is simulated by having that pin tied to gnd. Problem now is that by comparing the states of the data lines and the received ASCII code on the VB terminal. Sometimes they match and are expected results, sometimes, a wrong ASCII code with respect to the current data lines state is sent instead. Eg of a correct case, 'w' is received on VB and the data lines are '01110111'. Hence I will like to find out does polling of the PORTB using movf PORTB,will have any hidden implications? Thank Poll bcf STATUS,RP0 ; selecting bank0 cos PORTB in bank 0 movf PORTB,W ; polling of PORTB movwf Result ; move current state to general register Result --- Olin Lathrop wrote: > > Poll bcf STATUS,RP0 > > movf PORTB,W > > movwf Result > > iorwf Result,F > > Your description was too muddled for me to follow, > so I'm not sure what you > are trying to do. You should also add comments. > That shows you've at least > taken one of the minimum steps to fixing this > yourself, and lets us know > your intent. > > The only effect of the IORWF instruction is to set > the Z bit if the value in > RESULT is zero. > > > ***************************************************************** > Embed Inc, embedded system specialists in Littleton > Massachusetts > (978) 742-9014, http://www.embedinc.com > > -- > http://www.piclist.com#nomail Going offline? Don't > AutoReply us! > email listserv@mitvma.mit.edu with SET PICList > DIGEST in the body > > __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body