gnupic: PIC16F628
Subject:
PIC16F628
From:
"Ronald Mundell" ####@####.####
Date:
25 Jun 2002 07:06:46 -0000
Message-Id: <000901c21c15$4763d0d0$02a410ac@mundell>
Hi
Have any one used this chip before. I am experiancing a problem on port b. I
have configured PB.6 as an input but the software does not seem to be
working.
I have setup T1 to fire a laser via an interrupt on timer over flow and
configuresed pin PB6 and PB7 as inputs. If I manualy take this pins low then
my software does not detect it. the problem lies someware in the
configuration of the timer, but where I do not know
Here are a copy of the code.
void SetupTMR1 ( void )
{
// initialize timer 1;
T1CKPS1 = 0;
T1CKPS0 = 0; // set T1 prescaler to 1:1
TMR1CS = 0; // internal OSC/4
TMR1H = PRELOAD_HI; // Preload timer
TMR1L = PRELOAD_LO; // Preload timer
T1OSCEN = 1; // enable T1
TMR1IE = 1; // enable timer 1 Interupts
PEIE = 1; // enable all unmasked peripheral interupts
GIE = 1; // enable global interupts
TMR1ON = 0; // Make Sure T1 is OFF
}
I only fire the timer up when needed. If there are someone out there that
can help, please help.
Ronald