Advertisement
Guest User

Untitled

a guest
Jul 9th, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pic 16 15.29 KB | None | 0 0
  1.  
  2. ;  …ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ—ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  3. ;  ∫                                               ≥Author:              ∫
  4. ;  ∫                                ⁄ƒø⁄ƒƒ ⁄ ø     ≥  Daniel Henzulea    ∫
  5. ;  ∫        _\\|//_     (C) 1996 by √ƒ¥¿ƒø ≥ ≥     ≥  zulea@utcluj.ro    ∫
  6. ;  ∫       (` o-o ')                ¿ ŸƒƒŸ ¿ƒŸ     √ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ∂
  7. ;  «ƒƒƒƒƒƒooO-(_)-Oooƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ¥Automatic Soft - ASU ∫
  8. ;  ∫                      …ÕÕª …ÕÕª …  ª    ª …ÕÕª ≥Republicii 5/5       ∫
  9. ;  ∫                      ∫  ∫ ∫  ∫ ê ∫    ∫ ∫  ∫ ≥Cluj-Napoca 3400-RO  ∫
  10. ;  ∫    .oooO     Oooo.   ÃÕÕº ÃÕÕπ ∫»Õπ …ÕÕπ ÃÕÕπ ≥Phone  *40-64-197427 ∫
  11. ;  ∫    (   )     (   )   »    »  º »  º »ÕÕº »  º ≥Fax    *40-64-199794 ∫
  12. ;  «ƒƒƒƒ-\ (ƒƒƒƒƒƒƒ) /ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ¡ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ∂
  13. ;  ∫      \_)     (_/       RADIO SECURITY SYSTEMS                       ∫
  14. ;  »ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  15.  
  16. ;  …ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  17. ;  ∫ Program : SonaPIC                                                   ∫
  18. ;  ∫ Vresion : 1.2                                                       ∫
  19. ;  ∫ Comment : Clock:            4 Mhz                                   ∫
  20. ;  ∫           Oscilator Type:   HS                                      ∫
  21. ;  ∫           WatchDog:         ON                                      ∫
  22. ;  »ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  23.  
  24.  
  25.         Processor       16C84
  26.         Radix   DEC
  27.         LIST    F=INHX16
  28.         EXPAND
  29.  
  30.         include "16cxx.h"
  31.                 include "sonapic.h"
  32.  
  33.                 ORG     _ResetVector
  34.             goto    Start
  35.  
  36.             ORG     _IntVector
  37.             goto    Interrupt
  38.  
  39. ;…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  40. ;∫                   Main Program                                      ∫
  41. ;»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  42.  
  43. Start:
  44.  
  45.         btfsc   _to
  46. Loop:   goto    Loop
  47.         clrwdt
  48.     call    Init
  49.     call    ProgIdleTimer
  50.     call    StartInt
  51.     call    GetChar
  52.  
  53. MainLoop:
  54.     call    TaskRecByte
  55.     call    TaskSendByte
  56.     goto    MainLoop
  57.  
  58. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
  59.  
  60. ;…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  61. ;∫                  Interrupt service routines                         ∫
  62. ;»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  63.  
  64. Interrupt:
  65.  
  66.     movwf   SaveWReg
  67.     swapf   _status,w            ; affects no STATUS bits
  68.     movwf   SaveStatus           ; Only way OUT to save STATUS Reg !!
  69.  
  70.         btfsc   _rtif
  71.         goto    TimerInt
  72.     btfsc   _intf
  73.     goto    Int
  74.  
  75. RestoreIntStatus:
  76.     swapf   SaveStatus,w
  77.     movwf   _status              ; restore STATUS Reg
  78.     swapf   SaveWReg, F          ; save WREG
  79.     swapf   SaveWReg,w           ; restore WREG
  80.     retfie
  81. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
  82.  
  83. TimerInt:
  84.     bcf _rtif
  85.         clrwdt
  86.     movf    Counter2mS, f
  87.     btfss   _z
  88.     bsf GainControl          ; Set A max if past 2 ms from first
  89.     incf    Counter2mS, f        ; pulse transmited.
  90.     movfw   Counter2mS
  91.     sublw   InternDelayTime      ; Check if past the time between
  92.     btfsc   _z                   ; two pulses packets.
  93.     call    SendPulse            ; Yes: Send pulses.
  94.     goto    RestoreIntStatus
  95. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
  96.  
  97. Int:
  98.     bcf _intf
  99.     bcf _inte
  100.     movlw   BufferAdress         ; Store 8 LSBytes in buffer
  101.     addwf   IndexLowByte, w      ; The MSB is Counter2mS and the LSB is _rtcc
  102.     movwf   _fsr                 ; This two bytes count the time between
  103.     movfw   _rtcc                ; the first transmited pulse and the first
  104.     movwf   _indf                ; received pulse (echo).
  105.     incf    IndexLowByte, w
  106.     andlw   0x07                 ; Check if was made 8 measurements.
  107.     movwf   IndexLowByte
  108.     btfsc   _z                   ; Yes: Make the medium value for the LSB
  109.     call    LoadLowByte
  110.     movfw   Counter2mS
  111.     movwf   HighByteDelay        ; Store MSB.
  112.     goto    RestoreIntStatus
  113. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
  114.  
  115. ;…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  116. ;∫        Task receive byte on serial asinchronous input               ∫
  117. ;»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  118.  
  119. TaskRecByte
  120.  
  121.        btfss     RecByte             ; If the task isn't in working
  122.        return                        ; return.
  123.  
  124.        btfss     WaitStartBit        ; Wait for start bit ?
  125.        goto      ReadNextBit         ; No: Read the next bit.
  126.  
  127. WaitForStartBit:
  128.        btfsc     RxIN                ; Yes: Wait RxIN low.
  129.        return
  130.  
  131.        movfw     _rtcc               ; Store real time (detected start bit).
  132.        movwf     SerialRTCC
  133.        movlw     9                   ; The number of bits (8N1).
  134.        movwf     BitIndex
  135.        bcf       WaitStartBit        ; Reset flag for wait the start bit.
  136.        bsf       ReadStartBit        ; Set flag for read the start bit.
  137.        return
  138.  
  139. ReadNextBit:
  140.        btfsc     ReadStartBit
  141.        goto      StartBit
  142.        movfw     SerialRTCC          ; Is time to read next bit ?
  143.        subwf     _rtcc, w            ;
  144.        sublw     BitTimeSerial
  145.        btfsc     _carry
  146.        return                        ; No: Return.
  147.        decfsz    BitIndex, f         ; Yes: Dec the bit counter and check
  148.        goto      NotStopBit          ; if was the stop bit.
  149.  
  150. StopBit:                             ; Was the stop bit:
  151.        bcf   RecByte             ; Reset flag RecByte
  152.        goto      ByteReceived        ; Check the byte received
  153.  
  154. NotStopBit:
  155.        bcf       _carry
  156.        btfsc     RxIN                ; Read the bit.
  157.        bsf       _carry              ;
  158.        rrf       SerialRegister, f   ; Make the byte.
  159.        movlw     BitTimeSerial
  160.        addwf     SerialRTCC, f
  161.        return
  162.  
  163. StartBit:
  164.        movfw     SerialRTCC          ;
  165.        subwf     _rtcc, w            ; Is time to read start bit?
  166.        sublw     FirstBitTimeSerial
  167.        btfsc     _carry
  168.        return                        ; No:  Return.
  169.        btfsc     RxIN                ; Yes: Was a glitch ?
  170.        goto      GetChar             ;      Yes: Wait another byte (GOTO, no CALL!!!)
  171.        bcf       ReadStartBit        ;      No:  Reset flag read start bit.
  172.        movlw     FirstBitTimeSerial
  173.        addwf     SerialRTCC, f
  174.        return
  175.  
  176. ;…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  177. ;∫                Check the byte received                              ∫
  178. ;»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  179.  
  180. ByteReceived:
  181.     movfw   SerialRegister       ; Was the command for send the last
  182.     sublw   PleaseSendData       ; measurement ?
  183.     bz  SendData             ; Yes: Send data.
  184.     call    GetChar              ; No:  Wait to receive another byte.
  185.     return
  186. SendData:
  187.     bcf SendedSecondByte     ; Rest flag sended second byte.
  188.     movfw   HighByteDelay        ; Load first byte (MSB).
  189.     call    PutChar              ; Send the byte.
  190.     return
  191.  
  192. ;…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  193. ;∫                Task send byte on serial asinchronous output         ∫
  194. ;»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  195.  
  196. TaskSendByte
  197.  
  198.        btfss  SendByte               ; If the task isn't in working
  199.        return                        ; return.
  200.  
  201.        movfw  SerialRTCC
  202.        subwf  _rtcc, w
  203.        sublw  BitTimeSerial          ; Is time to send next bit ?
  204.        btfsc  _carry
  205.        return                        ; No:  Return.
  206.        btfsc  SendedStopBit          ; Yes: Was sended the stop bit ?
  207.        goto   SendNextByte           ;      Yes: Send next byte.
  208.        decfsz BitIndex, f            ;      No:  Is the stop bit ?
  209.        goto   SendNextBit            ;           No: Send next bit.
  210.  
  211.        bsf    SendedStopBit          ;           Yes: Set flag sended stop bit.
  212.        goto   SendStopBit
  213.  
  214. SendNextBit:
  215.        rrf    SerialRegister, f      ; Send the next bit.
  216.        bcf    TxOUT
  217.        btfsc  _carry
  218. SendStopBit:                         ; Send stop bit ( always '1' ;-)
  219.        bsf    TxOUT
  220.        movlw  BitTimeSerial
  221.        addwf  SerialRTCC, f          ; Store value for real time to read
  222.        return                        ; next bit.
  223.  
  224. ;…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  225. ;∫               Check if send more bytes ( only one... )              ∫
  226. ;»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  227.  
  228. SendNextByte:
  229.     btfsc   SendedSecondByte     ; Sended second byte ?
  230.     goto    Sended               ; Yes: Stop task send.
  231.     movfw   LowByteDelay         ; No:  Load second byte and send it.
  232.     call    PutChar
  233.     bsf SendedSecondByte     ; Set flag sended second byte.
  234.     return
  235.  
  236. Sended:
  237.     bcf SendedSecondByte
  238.     bcf SendByte             ; Stop task send bytes.
  239.     call    GetChar              ; Wait to receive a command.
  240.     return
  241.  
  242. ;…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  243. ;∫               Serial asinchronous procedures                        ∫
  244. ;»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  245.  
  246. PutChar
  247.        movwf    SerialRegister       ; Store value for real time to send
  248.        movfw    _rtcc                ; next bit.
  249.        movwf    SerialRTCC
  250.        movlw    9                    ; The number of bits (8N1).
  251.        movwf    BitIndex
  252.        clrf     SerialStatus         ; Reset all serial flags.
  253.        bsf      SendByte             ; Start task send.
  254.        bcf  TxOUT            ; Send start bit.
  255.        return
  256. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
  257.  
  258. GetChar
  259.  
  260.        clrf     SerialStatus
  261.        bsf      WaitStartBit         ; Set flag wait start bit.
  262.        bsf      RecByte              ; Start task receive byte.
  263.        return                        ;
  264.  
  265. ;…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  266. ;∫        Init PIC procedures (interrupts, hardware, regs ...)         ∫
  267. ;»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  268.  
  269. Init
  270.         movlw   0x0C
  271.         movwf   _fsr
  272. ClearRegs:                           ; Clear all data RAM.
  273.         clrf    _indf
  274.         incf    _fsr, f
  275.         movlw   0x2F
  276.         subwf   _fsr, w
  277.         bnz     ClearRegs
  278.  
  279.         bsf     _rp0             ; pag. 1
  280.  
  281.     movlw   0xFF
  282.     movwf   _trisa
  283.     movwf   _trisb
  284.  
  285.         bcf     GainControl          ; Make this pins outputs.
  286.         bcf     Out1
  287.         bcf     Out2
  288.         bcf     TxOUT
  289.  
  290.         bcf     _rp0             ; pag. 0
  291.         bcf     GainControl          ; Set initial values on outputs.
  292.         bsf     Out1
  293.         bcf     Out2
  294.         bsf     TxOUT
  295.         return
  296. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
  297.  
  298. ProgIdleTimer    ; Program the TMR0
  299.  
  300.     bsf _rp0             ; pag. 1
  301.     bcf _rts             ; TMR0 increments on internal clock
  302.     bcf _psa             ; at 8 uS ( prescaler 1:8 ).
  303.         bcf     _ps2                 ;
  304.         bsf     _ps1
  305.         bcf     _ps0
  306.     bsf _intedg
  307.     bcf _rp0             ; pag. 0
  308.     return
  309. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
  310.  
  311. StartInt:
  312.     clrf    _intcon
  313.     bsf _rtie                ; Start real time interrupt.
  314.     retfie                       ; Return with interrupts enabled.
  315.  
  316. ;…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  317. ;∫               Other procedures                                      ∫
  318. ;»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  319.  
  320. LoadLowByte              ; If was made 8 measurements make the
  321.                      ; medium value for LSB.
  322.     movlw   BufferAdress
  323.     movwf   _fsr
  324.     clrf    TempLowByte
  325.     clrf    TempHighByte
  326.     movlw   8
  327.     movwf   IndexLowByte
  328. LoopAdd:                 ; Add the 8 values.
  329.     movfw   _indf
  330.     addwf   TempLowByte, f
  331.     btfsc   _carry
  332.     incf    TempHighByte, f
  333.     incf    _fsr, f
  334.     decfsz  IndexLowByte, f
  335.     goto    LoopAdd
  336.  
  337.     movlw   3
  338.     movwf   IndexLowByte
  339. LoopShift:
  340.     bcf _carry
  341.     rrf TempHighByte, f
  342.     rrf TempLowByte, f
  343.     decfsz  IndexLowByte, f
  344.     goto    LoopShift
  345.  
  346.     movfw   TempLowByte
  347.     movwf   LowByteDelay
  348.     return
  349. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
  350.  
  351. SendPulse                ; Send 3 pulses at 40 kHz ( Yes, only 3 ).
  352.     clrf    Counter2mS
  353.     movlw   3
  354.     movwf   PulseCounter
  355. PulseLoop:
  356.     nop
  357.     nop
  358.     nop
  359.     nop
  360.     nop
  361.     nop
  362.     nop
  363.     bcf Out1
  364.     bsf Out2
  365.     nop
  366.     nop
  367.     nop
  368.     nop
  369.     nop
  370.     nop
  371.     nop
  372.     nop
  373.     nop
  374.     nop
  375.     nop
  376.     nop
  377.     bsf Out1
  378.     bcf Out2
  379.     decfsz  PulseCounter, f
  380.     goto    PulseLoop
  381.     bcf GainControl      ; Set A min.      
  382.     bcf _intf
  383.     bsf _inte                ; Start INT interrupt.
  384.     return                       ; ( wait echo on INT pin ).
  385.  
  386. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
  387.  
  388.     END
  389.  
  390. ;ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement