; Discador para nokia 1100 con pic 16f84a con protocolo fbus ; (C) Carlos Godoy 2010 ; Este programa usalo bajo tu propio riesgo, el autor no se ; responsable de los inconvenientes que pueda generar ; Por cualquier consulta enviame un mail a carlosvolt@gmail.com ; Página del proyecto www.carlosvolt.com.ar ; Puedes compartir, distribuir y modificar este proyecto ; siempre que menciones al autor. ; Este programa puede llamar a un número determinado y cortar ; a través del protocolo fbus de nokia, se utiliza un cristal ; de 4 Mhz. __CONFIG _CP_OFF& _WDT_ON& _PWRTE_OFF& _XT_OSC LIST P=16F84A INCLUDE P16F84A.INC status equ 03h optionr equ 81h trisa equ 85h porta equ 05h trisb equ 86h portb equ 06h PDel0 equ 20h PDel1 equ 21h PDel2 equ 22h PDel0b equ 23h Inicio: bsf status,5 ; se pasa al banco 1 de RAM clrf trisa ; se programa el puerto A como salida movlw 0fh; carga el registro de trabajo w con 0f movwf trisb ; se programa los 4 primeros bit del puerto B como entrada bcf optionr,7 ; se habilitan resistencias de Pull Up bcf status,5 ; se pasa al banco 0 de RAM call DEMORA; llama a una demora de 100 milisegundos call DEMORA; call DEMORA; call DEMORA; call DEMORA; Loop: call Demora btfsc portb,0; si es 0 salta / testea si el pulsador para llamar está precionado goto bcortar goto comenzar bcortar: btfsc portb,1; si es 0 salta / testea si el pulsador para cortar está precionado goto Loop call Demora call cortar call Demora goto Loop comenzar: call reset call Demora call reset call Demora call reset call Demora call numero call Demora goto Loop ;----Rutina para resetear---------------------- reset: call trama_1e call trama_00 call trama_0c call trama_40 call trama_00 call trama_06 call trama_00 call trama_01 call trama_64 call trama_03 call trama_01 call trama_60 call trama_77 call trama_24 return ;----Rutina para discar un número-------------- numero: call trama_1e call trama_00 call trama_10 call trama_01 call trama_00 call trama_21 call trama_00 call trama_01 call trama_00 call trama_01 call trama_09 call trama_00 call trama_31 call trama_00 call trama_35 call trama_00 call trama_36 call trama_00 call trama_39 call trama_00 call trama_38 call trama_00 call trama_32 call trama_00 call trama_35 call trama_00 call trama_34 call trama_00 call trama_36 call trama_05 call trama_01 call trama_05 call trama_00 call trama_02 call trama_00 call trama_00 call trama_01 call trama_01 call trama_45 call trama_00 call trama_74 call trama_23 return ;----Rutina para corta la llamada------------------- cortar: call trama_1e call trama_00 call trama_0c call trama_01 call trama_00 call trama_07 call trama_00 call trama_01 call trama_00 call trama_08 call trama_60 call trama_01 call trama_63 call trama_00 call trama_11 call trama_0e return ;----Rutinas para generar las distintas tramas----- ;----------genera la trama 1e-------- trama_1e: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;---------genera la trama 00-------- trama_00: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 0c-------- trama_0c: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 40-------- trama_40: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 06-------- trama_06: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 01-------- trama_01: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 64-------- trama_64: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 03-------- trama_03: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 60-------- trama_60: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 77-------- trama_77: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 24-------- trama_24: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 10-------- trama_10: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 07-------- trama_07: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 21-------- trama_21: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 09-------- trama_09: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 31-------- trama_31: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 35-------- trama_35: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 36-------- trama_36: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 38-------- trama_38: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 32-------- trama_32: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 39-------- trama_39: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 34-------- trama_34: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 05-------- trama_05: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 02-------- trama_02: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 45-------- trama_45: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 74-------- trama_74: bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 23-------- trama_23: bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 08-------- trama_08 bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 63-------- trama_63 bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 11-------- trama_11 bcf porta,0;////0 bit de Start call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;----------genera la trama 0e-------- trama_0e bcf porta,0;////0 bit de Start call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bsf porta,0;////valor del bit 1 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bcf porta,0;////valor del bit 0 call Demorab; bsf porta,0;////bit de Stop call Demorab; return ;--------------------Demora de 100 milisegundos---------------- DEMORA movlw .110 ; 1 set numero de repeticion (B) movwf PDel0 ; 1 | PLoop1 movlw .181 ; 1 set numero de repeticion (A) movwf PDel1 ; 1 | PLoop2 clrwdt ; 1 clear watchdog clrwdt ; 1 ciclo delay decfsz PDel1, 1 ; 1 + (1) es el tiempo 0 ? (A) goto PLoop2 ; 2 no, loop decfsz PDel0, 1 ; 1 + (1) es el tiempo 0 ? (B) goto PLoop1 ; 2 no, loop PDelL1 goto PDelL2 ; 2 ciclos delay PDelL2 goto PDelL3 ; 2 ciclos delay PDelL3 clrwdt ; 1 ciclo delay return ; 2+2 Fin. ;-------------------Demora de 1/115200-------------------------- DEMORAb PDelL1b goto PDelL2b ; 2 ciclos delay PDelL2b goto PDelL3b ; 2 ciclos delay PDelL3b return ; 2+2 Fin. end