Page 1 of 1

Interrupt issues in 18F4550

Posted: Wed Oct 05, 2011 3:33 pm
by electronix
Hi everybody.

I have been scratching my head past few days regarding interruptroutines in a 18F4550 MCU.
From the beginning the program was rather large and hard to overlook and the problem was that whenever I tried to make an interrupt(anywhwere in the program RB0/INT0) the interrupt macro only fired ones!? and the program just keept on running.

So I decided to make a simple test program, just blink an LED @ 1Hz, and when the Interuppt was triggered (RB0, falling edge) blink the same LED @ 2Hz, but the result was the same again! the interrupt triggered ones and then no more, the LED just keept flashing @ 1Hz.
And when I try to MCLR the MCU just comes to a halt(does nothing at all), the only way to retrigger the interrupt is to do a POR.

I have tried 2 MCUs, different settings in the config menu, different crystals.

So whats next to try? Any suggestions?

Thanx in advance
/Stefan

Re: Interrupt issues in 18F4550

Posted: Wed Oct 05, 2011 3:50 pm
by Benj
Hello Stephan,

How are you performing the interrupt? is it using your own C code or is it using the interrupt icon? Could you attach your current Flowcode program to the forums so I can try and see if I can spot what is going wrong for you.

Re: Interrupt issues in 18F4550

Posted: Wed Oct 05, 2011 4:05 pm
by electronix
Hello Ben.

Sure, here it is.
In one of my attempts I was only using Flowcode icons, in another one a C icon, containing a sleep(); instruction.

Best regards
/Stefan