list p=16c84 ; ; This program runs on special board for cordless phone link. ; This is light version (not vit full extras). For full version ;please send me e-mail. ; ; In the board, Port B (RB0 to RB7) is connected like inputs. ; ; #include ; #define PTT PORTA,0 ;output PTT #define SPK PORTA,1 ;output speaker #define HOK PORTA,2 ;output HOK Line wen is 0 #define SET PORTB,4 ;input strob DTMF #define RNG PORTB,5 ;input BEL count equ 0x10 ;couner timer CO74 equ 0x11 ;counter 4x lines AKK equ 0x12 ;memory for rotacion buf_d equ 0x13 ;bufer reciv DTMF ; delay equ 0x14 ;delay counter digit equ 0x15 delayms equ 0x16 ;delay in ms ; ; org 00h goto Start ; reset vector. org 5 Start bsf STATUS,RP0 clrf TRISA ;outputs movlw b'11111111' movwf TRISB ;B-inputs bcf STATUS,RP0 ;bank 0 clrf PORTA bsf HOK ;hok off test_SET btfsc SET goto front ;strob=1 DTMF btfsc RNG goto PTT_ON ;call btfsc HOK ;if not HOK off bcf PTT goto test_SET ;not strob PTT_ON bsf PTT movlw .8 call waitx goto test_SET front btfss SET ;test for front goto zapis ;saving goto front ;H to L ; zapis movf PORTB,w ;read portB andlw b'00001111' movwf buf_d ;bufer for DTMF movwf digit ;for dial decfsz buf_d,1 goto t_for_2 ;not 1 goto dial t_for_2 decfsz buf_d,1 goto t_for_3 ;not 1,2 goto dial t_for_3 decfsz buf_d,1 goto t_for_4 ; 1,2,3 goto dial t_for_4 decfsz buf_d,1 goto t_for_5 ; 1,2,3,4 goto dial t_for_5 decfsz buf_d,1 goto t_for_6 ; 1,2,3,4,5 goto dial t_for_6 decfsz buf_d,1 goto t_for_7 ; 1,2,3,4,5,6 goto dial t_for_7 decfsz buf_d,1 goto t_for_8 ; 1,2,3,4,5,6,7 goto dial t_for_8 decfsz buf_d,1 goto t_for_9 ; 1,2,3,4,5,6,7,8 goto dial t_for_9 decfsz buf_d,1 goto t_for_0 ; 1,2,3,4,5,6,7,8,9 goto dial t_for_0 decfsz buf_d,1 goto t_for_z ; 1,2,3,4,5,6,7,8,9,0 goto dial t_for_z decfsz buf_d,1 goto t_for_# ; 1,2,3,4,5,6,7,8,9,0,* goto call_z t_for_# decfsz buf_d,1 goto t_for_A ; 1,2,3,4,5,6,7,8,9,0,*,# goto call_D t_for_A decfsz buf_d,1 goto t_for_B ; 1,2,3,4,5,6,7,8,9,0,*,#,A goto call_D t_for_B decfsz buf_d,1 goto call_D ; 1,2,3,4,5,6,7,8,9,0,*,#,A,B goto call_D call_z bcf HOK ;on line bsf PTT ;on TX goto test_SET call_D bsf HOK ;off line bcf PTT ;off TX goto test_SET call_10 movlw .10 movwf digit goto dial dial nop digloop bsf HOK ;line open (38ms) movlw .38*2 call waitms bcf HOK ;line close (62ms) movlw .62*2 call waitms decfsz digit,f goto digloop movlw .3 ;interdigit delay 300ms (nominal 375ms) call waitx ;digdly movlw .4 ;delay 1/2 s ; call waitx goto test_SET ; ; w * 1/8 second delay ; wait1s movlw 8 waitx movwf count waitx1 movlw .125*2 call waitms decfsz count,f goto waitx1 return ; ; ; Delay (W = 1/2 milliseconds units) ; wait12 clrw ;delay 128ms waitms movwf delayms clrf delay ; call waste10 ;change this if RTC (real-time clock) call waste12 ;is implemented ;call rtcupd ; waitms1 decfsz delay,f ;256*3 goto waitms1 ; call waste10 ;see notes 6 lines above call waste12 ;call rtcupd ;22 ; decfsz delayms,f goto waitms1 return ; waste19 nop ;0 ~ 15 waste18 nop waste17 nop waste16 nop waste15 nop waste14 nop waste13 nop waste12 nop waste11 nop waste10 nop waste9 nop waste8 nop waste7 nop waste6 nop waste5 nop waste4 return ;2 ; ;***************************************** end