gnupic: Re: [gnupic] problems with timer0/interrupts


Previous by date: 3 Sep 2008 22:10:55 -0000 Re: [gnupic] PICkit2, Tom Schouten
Next by date: 3 Sep 2008 22:10:55 -0000 Re: [gnupic] PICkit2, Tom Schouten
Previous in thread: 3 Sep 2008 22:10:55 -0000 Re: [gnupic] problems with timer0/interrupts, Lope Vega
Next in thread:

Subject: Re: [gnupic] problems with timer0/interrupts
From: Robert Pearce ####@####.####
Date: 3 Sep 2008 22:10:55 -0000
Message-Id: <Z1w4jJh0pwvIFwDX@daniel.huneausware.local>

On Wed, 3 Sep 2008, Lope Vega ####@####.#### wrote :
>
>Then, what did was to setup interrupts for RB4:7 pins' state change,
>and within it's processing function, try to use timer0 to debounce the
>switch.
>
>However, when I program the device and place it on it's side of the
>breadboard, it seems the pic falls into the interrupt, and that the
>timer0 polling causes it to recurse into it undefinetely.

>        ;;
>        ;; rb* interrupt-handler
>        ;;
>_handle_rb_interrupt    code
>handle_rb_interrupt:
--- you need to add
        movf    portb,w
    here ---
>        ;; clear it's flag bit
>        bcf     intcon, rbif
>

If I remember rightly, the portb interrupt on change function continues
to see the change until you read portb. You are not reading portb in
your ISR, so clearing the rbif bit is not doing any good.
-- 
Rob Pearce                       http://www.bdt-home.demon.co.uk

The contents of this | Windows NT crashed.
message are purely   | I am the Blue Screen of Death.
my opinion. Don't    | No one hears your screams.
believe a word.      |

Previous by date: 3 Sep 2008 22:10:55 -0000 Re: [gnupic] PICkit2, Tom Schouten
Next by date: 3 Sep 2008 22:10:55 -0000 Re: [gnupic] PICkit2, Tom Schouten
Previous in thread: 3 Sep 2008 22:10:55 -0000 Re: [gnupic] problems with timer0/interrupts, Lope Vega
Next in thread:


Powered by ezmlm-browse 0.20.