> PAGE
>; Code for ClockIn
> org 0
> goto MainLine ; Skip Over Output Tables
> org 4
>Int ; Interrupt Handler
>; #### - There Should be Some Context Register Saving Here/Event Display
> goto $ ; Infinite Loop When you Get Here
>MainLine ; Enable Interrupts with the Timer waiting for
> ; a Rising Edge
> movlw B'11000000' ; First Setup with Instruction Clock as TMR0
> option ; Source
> movlw B'11100000' ; Option Setup For TOCK1 TMR0 Source
> clrf TMR0 ; Set TMR0 to 0x0FF
> decf TMR0
> option ; Enable Timer on Outside Interrupt Edge
> ; NOTE - Executing this Instruction after
> ; "decf" will Load the Synchronizer with a
> ; "1"
> movlw 0x0A0 ; Enable TMR0 Overflow Interrupt
> movwf INTCON
> goto $ ; Loop Forever Waiting for the Interrupt
> end
>The Stimulus File Used to Test this Program is:
>! CLOCKIN.STI - Test ClockIn Program
>! 98.02.20
>! Myke Predko - This PIC Stimulus File is used to Input a Rising Edge into
>! "ClockIn" to See if the Timer Input Pin can be used as a
>! Interrupt on Input State.
>Step RA4
> 1 0 ! Starting, With Line Low
>14 1 ! Make the Line High, Do we have an interrupt?
> ! End of Test Stimulus File
>I have *only* tested this on MPLAB 3.31. I'll probably try it out tonight
>on some hardware (although I'll have to make sure the rising edge I input
>into TMR0 does not have any bouncing).
>Any reasons why this code shouldn't work in hardware?
>myke
>"Programming and Customizing the PIC Microcontroller" is the January 1998
>Electronics Book Club Main Selection. See "
http://www.myke.com".