;********************************************************************* ; * ; PIC16F628 Tutorial 4: Counter Mode Falling TOCKI + prescalar * ; * ;********************************************************************* ;* TARGET PIC16F628 ;********************************************************************* ;* @version 0.1, 13 November 2001 ;* @author James Caska ;********************************************************************* ;* ;* Runs on Processors without change ;* ;* PIC16F628 ;* ;********************************************************************* #include list p=16F628 ORG .0 ;========================================== ;Autogenerated configuration code pic16C62X ;Config Wiz V0.1, www.virtualbreadboard.com ;========================================== ;======Begin PORT Configuration BSF STATUS,RP0 ;Set Bank1 ;======PORT A MOVLW .63 ;PORTA Configuration Bits MOVWF TRISA ;======PORT B MOVLW .0 ;PORTB Configuration Bits MOVWF TRISB BCF STATUS,RP0 ;Restore Bank0 ;========================================== ;Autogenerated configuration code pic16C62X ;Config Wiz V0.1, www.virtualbreadboard.com ;========================================== ;======Begin Timer0 Configuration ;Timer0 Counter Mode, uses External clock source ;T0SE: TMR0 Source Edge Select bit: Increment on high-to-low transition on T0CKI pin ;Prescalor Assigned Timer0, Timer0 Prescalor = 1:16 , Watchdog prescalor 1:1 MOVLW .51 BSF STATUS,RP0 ;Option is in Bank1 MOVWF OPTION_REG BCF STATUS,RP0 ;Restore Bank0 ;======Timer0 Interrupt Configuration BCF INTCON, T0IE ;Timer 0 InterruptEnableOff ;======End Timer0 Configuration MAIN MOVF TMR0,W MOVWF PORTB GOTO MAIN END