Actually this is a test program. what i am going to do is when i give the pin_b0 a H to L edge then it output different value from pin_a1 that means if there is continued interrupts then pin_a1 output should be like H L H L.....
But its act not what i planned other than weird. sometimes it no response when i give HTOL edge and sometimes it acts when i give LtoH edge.
Please help me find out what is the problem. Thanks in advance.
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
Posted: Thu Jul 22, 2010 9:57 am
How are you generating the edges?.
The commonest reason for the interrupt to trigger on what is seen as the 'wrong' edge, is bounce. You make a switch, thinking this just closes a contact, but in reality you get more than one make/break sequences, and the interrupt 'sees' the extra edge.
The other thing is whether you are sure the source is really crossing the required voltage thresholds. The INT input on the 16F84, is a Schmitt trigger input. Requires the voltage to go over 4v to 'see' a 'high' (if running on a 5v supply). Are you sure it is....
As a final couple of comments:
1) Use the code buttons - makes it much easier to read your code.
2) You don't have to clear the interrupt in the ISR. CCS does this for you (unless you specifically tell it not to...).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum