Message-ID: <365F2A0D.2DC243F3@xs4all.nl> Date: Fri, 27 Nov 1998 23:39:09 +0100 From: M van der Bilt Reply-To: marbel@xs4all.nl Organization: Electronica Werkplaats Scoop X-Mailer: Mozilla 4.04 (Macintosh; I; PPC) MIME-Version: 1.0 To: "pic microcontroller discussion list " <"pic mic rocontroller discussion list PICLIST"@MI TVMA.MIT.EDU> Subject: change table read or what Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello i am simulating the wheels i a mouse the X part of the following code works fine but then there is the problem with the Ymovement part when i want to move the data to portB i don't wand any bits affected i thought to do this with xorwf but the data on pin 1,2 is not affected data on pin 3,4 disturbs table output how to solve this change table? Marcel marbe@xs4all.nl Amsterdam ;**************************************************************** ; quadrature.ASM ; ;**************************************************************** ;EQUATES PIC84 equ 0x00 PortA equ 0x05 PortB equ 0x06 Stepx equ 0x0C Rightx equ 0x00 Countx equ 0x0D Stepy equ 0x0E Righty equ 0x01 County equ 0x0F temp equ 0x10 F2Posi equ 0x01 Flags2 equ 0x11 Xbit equ 0x05 Ybit equ 0x07 ORG 0x05 Table ; tabel to look up previous or next step addwf PCL,f retlw b'00000000' retlw b'00000010' retlw b'00000011' retlw b'00000001' Start clrf PortA ; movlw B'00000010' ; make pin 2 input others output TRIS PortA ; move to tristate register clrf PortB ; movlw B'00000000' ; all pin's on port B output TRIS PortB ; move to tristate register clrf Stepx ; clear step X register clrf Stepy ; clear step Y register clrf TMR0 ; clear timer register clrf temp ; clear temp register movlw 0x10 movwf Countx movwf County main btfsc PortB,F2Posi bsf Flags2,F2Posi btfsc PORTB,Xbit ; test xbit= horizontal | goto RightLabel_Y ; if lo goto y = vertical | bcf PORTB,Ybit ; Switch Yinput off | bsf PORTB,Xbit ; Switch Xinput on | goto RightLabel_X