Searching \ for '[PIC]: Using the capture function on 16F877' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: 'Using the capture function on 16F877'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Using the capture function on 16F877'
2001\02\07@130951 by Fred Bailey

flavicon
face
I am having trouble with the capture feature.
I am using RC1 and RC2 as inputs to the CCP1 and CCP2. I can't get the
interrupt to occur on either of these.
I have rising edge pulses of 50 uSec spaced at 60 Hz on RC1 and RC2. My Crystal
is 20MHz.
The following code is applicable:

    movlw     0x3D
    movwf     T1CON               ; set up timer1 for internal clock,1:8
Prescale,timer on
    clrf TMR1H               ; clear timer 1 high register
    clrf TMR1L               ; clear timer 1 low register
    bcf  PIE1, CCP1IE        ; disable interrupts from capture
    bcf  PIE2, CCP2IE
    clrf CCP1CON        ; Clear prescaler
    movlw     0x05
    movwf     CCP1CON        ; set up Capture Mode on every rising edge of
pulse1
    clrf CCP2CON        ; Clear prescaler
    movlw     0x05
    movwf     CCP2CON        ; set up Capture Mode on every rising edge of
pulse2
    bsf  PIE1, CCP1IE        ; Re-enable interrupts from capture
    bsf  PIE2, CCP2IE

I have other interrupts such as RB0 and TMR0 working. I just cant get these
captures to work. Is there a trick I'm missing?
Any help would be appreciated.

Fred Bailey

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\02\07@163053 by Drew Vassallo

picon face
>I have other interrupts such as RB0 and TMR0 working. I just cant get these
>captures to work. Is there a trick I'm missing?
>Any help would be appreciated.

The only thing I can see is that you don't select Bank 1 when you adjust the
PIE or PCON registers.  You need to.  The rest of your registers accessed
are in Bank 0.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...