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
Interrupt issues in 18F4550
Moderator: Benj
-
electronix
- Posts: 58
- Joined: Sat Aug 22, 2009 5:45 pm
- Has thanked: 17 times
- Been thanked: 7 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Interrupt issues in 18F4550
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
electronix
- Posts: 58
- Joined: Sat Aug 22, 2009 5:45 pm
- Has thanked: 17 times
- Been thanked: 7 times
Re: Interrupt issues in 18F4550
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
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
- Attachments
-
- sleep_test_18f4550_3.rar
- (1.14 KiB) Downloaded 208 times