Asian digital wrote: > Hi, > I'm quite interested in your frequency counting project. Would you > mind emailing me more information? Thanks. > > Regards > Peter Hi Peter, this is the routine RA2 is connected to TMR0 input and the input is connected to signal via 47K resistor. The routine return the 24 bit value in REG3,REG2,REG1 ;****************************************************** ; ROTINA DE CONTAGEM, TEMPO DO LOOP 16us ; To 0.1s GATE=25 ; To 1s GATE=250 ;****************************************************** CONTA BCF PORT_A,2 ;PARA CONTAGEM CLRF REG3 ;ZERA O REGISTRO CLRF REG2 CLRF REG1 MOVLW 250 ;250 NORMALMENTE MOVWF COUNT ;ZERA CONTADOR DE TEMPO CLRF RTCC NOP NOP BSF PORT_A,3 ;LIBERA CONTAGEM CONTINUA NOP NOP NOP NOP C0 NOP NOP NOP BTFSC INTCON,RTIF ;TESTA ESTOURO GOTO INCRM NOP GOTO NINCR INCRM BCF INTCON,RTIF INCF REG3,1 ;SIM INCREMENTA REG3 NINCR DECF COUNT,1 BTFSS STATUS,Z GOTO CONTINUA MOVLW 250 MOVWF COUNT DECFSZ GATE,1 GOTO C0 BCF PORT_A,3 ;PARA CONTAGEM MOVF RTCC,W MOVWF REG2 ;SALVA RTCC MAIS DECF REG1,1 BSF PORT_A,RS ;\INCREMENTA PRESCALLER NOP BCF PORT_A,RS ;/ MOVF REG2,W XORWF RTCC,W ;VE SE RTCC MUDOU BTFSC STATUS,Z GOTO MAIS ;NAO MUDOU INCF REG1,1 RETURN -- ======================================================== Octavio Nogueira e-mail: nogueira@mandic.com.br homepage: http://ourworld.compuserve.com/homepages/tato voice/fax: +55 11 240-6474 ======================================================== "ProPic" The first Production PIC Programmer running in Windows and under US$ 20.00. Avaible at http://ourworld.compuserve.com/homepages/tato