jeste jednou citaz

Jan Waclawek wek@evona.sk
Pondělí Srpen 13 09:17:33 CEST 2007


Mno prosim, presne takto to dopadne ked ceckari kecaju o produktivite... :-)

(uz davno tu nebol ziadny poriadny flame)

wek


Snail Instruments wrote:
> 
> Udelal bych to takhle - privadet pulsy na vstup CCP. Spustit TMR1 s 
> preddelickou 1:1, CCP nastavit na capture mod. Potom bych nechal 16x 
> pretect TMR1 a behem te doby pocital pulsy. V asm by to bylo asi takhle:
> 
>          clrf    pcnt    ;citac pulsu CCP
>          clrf    pcnt+1
>          clrf    tcnt    ;citac preteceni TMR1
>          movlw   b'00000001'
>          movwf   t1con
>          movlw   b'00000100'
>          btfss   portb,rb3
>          movlw   b'00000101'
>          movwf   ccp1con
> frq0:   btfss   pir1,ccp1if
>          goto    frq0
>          movf    ccpr1h,w
>          movwf   edge
>          movf    ccpr1l,w
>          movwf   edge+1
>          bcf     pir1,tmr1if
>          bcf     pir1,ccp1if
> frq1:   btfss   pir1,ccp1if
>          goto    frq2
>          incf    pcnt+1,f
>          btfsc   status,z
>          incf    pcnt,f
>          bcf     pir1,ccp1if
> frq2:   btfss   pir1,tmr1if
>          goto    frq1
>          bcf     pir1,tmr1if
>          incf    tcnt,f
>          movf    pcnt,w
>          iorwf   pcnt+1,w
>          btfsc   status,z
>          goto    frq2
>          movf    tcnt,w
>          addlw   -d'16'
>          btfss   status,c
>          goto    frq1
>          clrf    ccp1con
>          ;no a tady bude vypocet frekvence



Další informace o konferenci Hw-list