let me explain.
1- i use INTCON = %10001000
it means i enable GIE bit, porta change int bit AND clear all interrupt flags. So i DO clear int flags.
2- in my previous project (called int.pcb, wonder why...), i didn't read porta before enabling interrupts (to clear potential mismatch), BUT ra3 was not enabled for int in IOCA register so it didn't trigger interrupt if not tied to vdd with a wpu.
Yep...sure do...and that's all fine and dandy...
But!....3 posts ago...one of those sentences is STILL not like the others...2- in my previous project (called int.pcb, wonder why...), i didn't read porta before enabling interrupts (to clear potential mismatch), BUT ra3 was not enabled for int in IOCA register so it didn't trigger interrupt if not tied to vdd with a wpu.
And I had a look at your code...one small thing (I think) and you'll be set...
Come on ski.
You're not being a "Teacher".
You are purposely tormenting him. And enjoying it.
It's a single line of code.
Just tell him.
<br>
DT
But I'm not a teacher, heck, as you all probably know, I'm not even a programmer!
I am, however, a leader. Ask any of the guys that I trained to replace me, and they have...they'll tell you...(show me your war face! Arrrrrggghhhh!)
And I'm not enjoying it. It's like having a noob (at my job anyways) and trying to explain the inner workings of a synchro system and how it fully applies to an autopilot system...and he just doesn't get it (ran into this exact situation last week). Felt like slapping the kid across the flightline. Took him 3 days, then he came in monday morning with the answers and it had all clicked over the weekend (of course I had assigned him weekend duty just to try and comprehend the whole thing)...
Remind me not to fly on one of your planes.
When people get thrown extra duty because they didn't know something and the boss refused to help.
It's likely they won't bother asking questions the next time they have problems.
Who know's what goes un-fixed.
Fine, I'll do it.
xnihilo,
Remove the other INTCON statement.Code:i VAR BYTE i = PORTA ' Clear mismatch condition INTCON = %00001000 ' enable porta interrupts on change and clear flag ON INTERRUPT GOTO in_sig ' int routine
DT
WHOA! Don't get me wrong...I'm not that much of a jerk. They had it coming to them anyways...regardless if they would've had the answer or not.
And I had given them ALL of the tools they needed to solve the issue at hand.
And...don't forget...I'm a pilot myself. I know the responsibility that comes with having others living directly in your hands.
Sounds like a 'Hair Club for Men' commercial...
Not only am I a pilot, but I work on them too...
At any rate...I hope that fixes the issue with the program. I was going to fix it in a more roundabout way, but your solution works better.
Last edited by skimask; - 21st March 2008 at 23:03.
It looks like I could finaly prevent interrupts occuring without no reason.
I still have to thoroughly test the program.
I would like to know what's the need for GIE.
In your code above, you don't enable GIE at all, I followed your instructions and it worked.
I thought that in order for Interrupts for PORTA change (or any interrupts) to be enabled, GIE bit had to be set. I could not find clear information neither in pbp manual nor in the pic datasheet.
I have more strange things happening though, in my program just after the int routine label if I add an LCD output with the value of variable "a" bits (with a loop of 6 iterations and LCDOUT #a.0(i)) after an "a=porta" to get port pins values and clear mismatch), the value displayed doesn't change no matter what pin triggered the int (even if the right pin is detected), and ever more strange, after the interrupt routine is finished and before going back to the infinite loop, the value of portA bits is displayed once again, with no reason...
Subtleties...
Anyway, thanks a lot for your help, hope it solved the problem. It is still not crystal clear for me how to use stuff related to interrupts, I'm using the instructions more or less empiricaly and I'm not sure about the order in which I write the program sections.
If you have some time to waste, maybe you could have a look at my program and let me know if you see very horrible things
http://users.edpnet.be/charlesetchri...g/se230308.pbp
Best regards
'cause you like things like heating pads and shooting things I guess.
And no, I haven't seen SAW. Should have seen SAW? I'll ask the wife if she saw SAW...while she's on the see-saw. Maybe she saw SAW. Maybe I should go see SAW. If I saw SAW, maybe I'd see what you saw when you saw SAW. I'll report back after I see SAW to tell you what I saw when I saw SAW.
Bookmarks