PBP array in ASM statements


Results 1 to 20 of 20

Threaded View

  1. #5
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: PBP array in ASM statements

    Here it is ISR
    Code:
    if PIR2.1=1 then
       T3CON=%00000110
       Wp= Wp & uwp
       Xn.0=IN1
       Xn.1=IN2
    
       
       IF (Xn.0<Xs.0 AND Trf=0) OR  (Xn.0<Xs.0 AND Xn.1=1 AND Trf=1) THEN
    @     INCF _Counter,F 'this work
          IF Counter[0] = Mtp2[0] OR (Counter=256 AND Mtp2[0]=0)THEN
    @      CLRF _Counter ' and this
              CNT[0]=CNT[0] + Add[0]
          ENDIF
       ENDIF
       
       IF (Xn.1<Xs.1 AND Trf=0) OR (Xn.0<Xs.0 AND Trf=1 AND Xn.1=0) THEN
    @     INCF _Counter+1,F 'Counter[1] = Counter[1] + 1  'won't work
          IF Counter[1] = Mtp2[1] OR (Counter[1]=256 AND Mtp2[1]=0)THEN
    @      CLRF _Counter+1'Counter[1]=0 'won't work
              CNT[1]=CNT[1]+Add[1]
          ENDIF
       ENDIF
       Xs=Xn
    
    @  CLRF PIR2
    endif
    Pic is 18LF14K50
    EDIT:
    bank0 or bankA is same...
    I tried RTC,it works fine with both.
    Last edited by pedja089; - 28th May 2011 at 21:14.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts