Searching \ for 'Code using TMR0 works great on 16F84, but no go on' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=16F
Search entire site for: 'Code using TMR0 works great on 16F84, but no go on'.

Truncated match.
PICList Thread
'Code using TMR0 works great on 16F84, but no go on'
1998\05\15@192248 by Craig Lee

flavicon
face
Anybody know why this would happen.  The code works perfectly
under the 16F84.

I am using the TMR0 overflow interrupt to call an
interrupt handler.


***********************code*************************
static void
InitPulser(void)
{
    curr_enc_data = 0;  /* The encoder data */
    prev_enc_data = 0;    /* The previous reads data */
    errors   = 0;  /* Error data */
    fwd_pulse_count= 0;  /* The forward pulse counter */
    rev_pulse_count= 0;  /* The reverse pulse counter */
    T0IE  = 1;     /* enable the TMR0 overflow */
    TMR0  = 0xFF;    /* set to overflow every 128 uS */
    T0CS  = 0;     /* increment on internal clock */
    PSA   = 0;     /* prescaler to TMR0 */
    PS0  = 1;     /* prescaler set to 1/256 */
    PS1  = 1;     /* which is a TMR0 increment */
    PS2  = 1;     /* every 128 uS using 8MHz xtal*/
    TRISA = 0xF3;    /* set the pulser bits to inputs */
        /* ra2 and 3 used for debug */
    TRISB = 0x00;    /* for debug */

   GIE = 1;    /* enable all interrupts */
}


static void interrupt
Isr(void)
{
    if (T0IF)       /* timer 0 has overflowed */
    {
        Pulser_Interrupt_Handler();/* go deal with it */
    }
}


static void
Pulser_Interrupt_Handler(void)
{
    char temp;
    T0IF  = 0;              /* clear interrupt flag */
    TMR0  = 0xFF;    /* reload to overflow in 128 uS */

***********************snip*************************

Pulser_Interrupt_Handler(), never gets called   when using the 16C62A,
or the 16C72.


Anyone have a clue?!

Craig

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