Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #380911

OT: table CALL does not work

From Robert Baer <robertbaer@localnet.com>
Newsgroups sci.electronics.design
Subject OT: table CALL does not work
Message-ID <TGURx.175753$WK.81663@fx10.iad> (permalink)
Date 2015-10-09 12:36 -0700

Show all headers | View raw


   Program:

        LIST p=P16F648A
        #include P16F648A.inc
          ; Was P16F628A
        __CONFIG       _CP_OFF & _WDT_OFF & _PWRTE_OFF & _HS_OSC & 
_LVP_OFF & _MCLRE_OFF & _BOREN_OFF
        __IDLOCS       0x0001

;                  VARIABLES
ptrlo       EQU         0x20    ; table pointer
ptrhi       EQU         0x21
COUNT1      EQU         0x22    ; delay counter
COUNT2      EQU         0x23
COUNT3      EQU         0x24
sSTATUS     EQU         0x25
sW          EQU         0x26
;
         ORG     0x0000
         GOTO    start
         GOTO    start
         GOTO    start
         GOTO    start
         ORG     0x0010
start:  ;**             setup I/O
; All pins have 10K in series with an LED to GND except OSC pins (and GND)

         CLRF    6    ; Set all Port B pins to logic 0
         BSF     3,5  ; Bank 1 command comes next STATUS RP0 set
         CLRF    6    ; sel all Port B pins as outputs
         BCF     3,5  ; Bank 0 command comes next STATUS RP0 clear

         CLRF    ptrlo
         CLRF    ptrhi

         CLRW
         MOVWF   6       ; Port B to zero
         CALL    DELAY   ; "freeze" LEDs

         MOVLW   0xFF
         MOVWF   6       ; Port B ones
         CALL    DELAY   ; "freeze" LEDs
setup:
        MOVLW    Low(tab1)
        ADDWF    ptrlo,W   ; add pointer to W
        MOVLW    High(tab1)
        BTFSC    STATUS,C
        INCF     PCLATH,F  ; W=1
        CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01 repeating
     ;   RETurns here      ;; otherwise, LEDs show 0x00 0xFF repeating
         MOVWF   6       ; Port B from W
         CALL    DELAY   ; "freeze" LEDs
         GOTO    start

repeat:	;;*This part disabled for now..
         INCF    ptrlo           ; next loc
;        BTFSC   STATUS,C
;        INCF    ptrhi
         MOVF    ptrlo,W
     ;  CALL     tab1    ;;*REMoving this, one sees W counting
                 ;; otherwise, LEDs show 0x00 0xFF 0x00 0xFF 0x00 etc
         MOVWF   6       ; Port B from W
         CALL    DELAY   ; "freeze" LEDs
         GOTO    repeat

; ----------------------------------------------
DELAY   MOVWF   sW
       ; MOVF    STATUS,W
       ; MOVWF   sSTATUS
         CLRF    COUNT1
         CLRF    COUNT2
         MOVLW   d'43'  ; fudge for about 4 Sec delay
         MOVWF   COUNT3
LUPINR  DECFSZ  COUNT1
         GOTO    LUPINR
         DECFSZ  COUNT2
         GOTO    LUPINR
         DECFSZ  COUNT3
         GOTO    LUPINR
DEXIT:; MOVF    sSTATUS,W
       ; MOVWF   STATUS
         MOVF    sW,W
         RETURN
; ---------------------------------------------- sine
         ORG             0x0100
tab1:
      ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
         ADDWF   PCL,F
         RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
         RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
         RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
         RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
         RETLW   0x02    ;       [5]     t=0.7695        r=0.6040

   WHAT in all heck is happening??

Back to sci.electronics.design | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-09 12:36 -0700
  Re: OT: table CALL does not work "P E Schoen" <paul@pstech-inc.com> - 2015-10-09 18:00 -0400
    Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-10 00:19 -0700
  Re: OT: table CALL does not work Nobody <nobody@nowhere.invalid> - 2015-10-09 23:32 +0100
    Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-10 00:32 -0700
      Re: OT: table CALL does not work Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-10 09:56 +0100
        Re: table CALL does not work "P E Schoen" <paul@pstech-inc.com> - 2015-10-10 18:38 -0400
          Re: table CALL does not work Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-12 09:10 +0100
      Re: OT: table CALL does not work Nobody <nobody@nowhere.invalid> - 2015-10-11 22:50 +0100
        Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-11 23:23 -0700
  Re: OT: table CALL does not work Martin Riddle <martin_ridd@verizon.net> - 2015-10-11 00:27 -0400
    Re: OT: table CALL does not work Martin Riddle <martin_ridd@verizon.net> - 2015-10-11 00:33 -0400
      Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-11 13:37 -0700
        Re: OT: table CALL does not work Martin Riddle <martin_ridd@verizon.net> - 2015-10-11 20:54 -0400
    Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-11 13:35 -0700
  Re: OT: table CALL does not work bitrex <bitrex@de.lete.earthlink.net> - 2015-10-11 16:44 -0400
    Re: OT: table CALL does not work Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-12 18:12 +0100

csiph-web