piclist 1998\11\27\174746a >
Thread: change table read or what]
picon face BY : marbelspam@KILLspamxs4all.nl

part 0 2778 bytes content-type:text/plain; charset=us-ascii (decoded 7bit)

Message-ID: <spam_OUT365F2A0D.2DC243F3spamxs4all.nl>
Date: Fri, 27 Nov 1998 23:39:09 +0100
From: M van der Bilt <.....marbelRemoveMEspamRemoveMExs4all.nl>
Reply-To: marbel@spam@spam@spam@xs4all.nl
Organization: Electronica Werkplaats Scoop
X-Mailer: Mozilla 4.04 (Macintosh; I; PPC)
MIME-Version: 1.0
       "pic microcontroller discussion list <@spam@PICLIST@spam@spamspamMITVMA.MIT.EDU>" <"pic mic
rocontroller discussion list <TakeThisOuTPICLISTspamMITVMA.MIT.EDU>                PICLIST"@MI
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?


; quadrature.ASM


         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'

        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
        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


See also: www.piclist.com/techref/mems.htm?key=table
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) change table read or what]

month overview.

new search...