Hi Scott, why not try this readkey btfss porta,0 goto key1_press btfss porta,1 goto key2_press retlw 00 key1_press call debounce btfsc porta,0 retlw 00h retlw 01h key2_press call debounce btfsc porta,1 retlw 00h retlw 02h Regards Pailoor "Mitchell D. Miller" wrote: > > Scott, > > The problem here is that every time you 'RRF PORTA', the entire port it > read, and the first bit is rotated into the C bit. Rather than rotating the > port each time, you need to read the port into memory first, then rotate > that data. Example: (sorry for the mixed Parallax & Microchip mnemonics) > > movw porta > movf myvar, w > rrf myvar > btfsc status, c > goto code1 > rrf myvar > btfsc status, c > goto code2 > . > . > . > > Only problem this creates is that any changes in portA during processing are > not recognized until next time through this code. > > Mitch Miller > Omaha, NE > mdmiller2@home.com > > ----- Original Message ----- > From: Scott > To: > Sent: Tuesday, October 19, 1999 8:02 PM > Subject: Polling PortA > > > I want to use portA to read two switches for one project and four > > switches for another. How do I make each bit rotate through the carry > > flag consecutivly. I have been using the following code, but it only > > reads the first bit. I am using a 16c56 > > > > > > movlw 0x0F > > tris PORTA > > movlw 0x00 > > tris PORTB > > > > input bcf STATUS, C > > rrf PORTA, W > > btfsc STATUS, C > > goto code_1 > > rrf PORTA, W > > btfsc STATUS, C > > goto code_2 > > goto input > > > > I was able to write the rest of this program and simulate it with > > success and I have been stareing at this part for four hours with no > > luck. > > > > Scott -- Website : http://www.chiptechnologies.com Website : http://business.vsnl.com/chiptech Content-Type: text/x-vcard; charset=us-ascii; name="chiptech.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Ravi Pailoor Content-Disposition: attachment; filename="chiptech.vcf" Attachment converted: wonderland:chiptech.vcf 1 (TEXT/CSOm) (0000E0FD)