gnupic: Even more info on Setting up CCP2 module


Previous by date: 12 Nov 2002 04:36:33 -0000 More info on Setting up CCP2 module, Rick Mann
Next by date: 12 Nov 2002 04:36:33 -0000 Yet even more info on Setting up CCP2 module, Rick Mann
Previous in thread:
Next in thread:

Subject: Even more info on Setting up CCP2 module
From: Rick Mann ####@####.####
Date: 12 Nov 2002 04:36:33 -0000
Message-Id: <B9F5C42B.F184%rmann@latencyzero.com>

Okay, I lied. I only just now verified TRISC, and it's NOT what I set! I
execute (in Bank 1):

    movlw   b'11000010'
    movwf   TRISC

but when I read TRISC later, I get

            b'10000011'

out of it. WTF? Is the USART getting involved here? I do also enable that.

So I wrote a tiny program:

    org 0
    clrf    STATUS
    clrf    INTCON
    bsf     STATUS,RP0
    movlw   b'11000010'
    movwf   TRISC
    clrf    TRISD

    bcf     STATUS,RP0

Loop
    movwf   PORTC
    movwf   PORTD
    goto    Loop

Guess what? It definitely shows the IR module's output, as expected. But
when my complete code gets a hold of it, TRISC is b'10000011' (despite the
fact that I set it just like I did above), and a similar loop like the one
above doesn't show the IR port status. I've poured over the code looking for
anyone stepping on TRISC, or a neighboring register in another bank, to no
avail.

As always, any input is much appreciated. Thanks!

on 11/11/02 7:51 PM, Rick Mann at ####@####.#### wrote:

> I've verified that Timer 1 is indeed running, that the CCP2IE enable is set,
> and that the CCP2IF interrupt flag is never being set. I've also verified
> that no value is ever getting captured.
> 
> I've verified that CCP2CON contains b'00000100'. TRISC contains b'11000010'.
> I've even tried it with two different boards to see if it was a bad PIC.
> 
> Why won't CCP2 capture? I've made it work before, but for the life of me I
> can't figure out why it won't work now.
> 
> Frustrated,
> 
> -- 
> Rick

-- 
Rick Mann               ####@####.####
650 592-2300 v          http://latencyzero.com/
650 576-7170 c



Previous by date: 12 Nov 2002 04:36:33 -0000 More info on Setting up CCP2 module, Rick Mann
Next by date: 12 Nov 2002 04:36:33 -0000 Yet even more info on Setting up CCP2 module, Rick Mann
Previous in thread:
Next in thread:


Powered by ezmlm-browse 0.20.