MC9S08GT16A - Keyboard interrupt problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S08GT16A - Keyboard interrupt problem

1,959 Views
sm
Contributor I
Hello,

I work with a MC9S08GT16A.

I have an interrupt whan I press my Button, but not every time I remove my finger.

You can see below my configuration:

Is there an errata sheet with this kind of problem?

I thank you a lot.



Code:
//PULL-UP for my BP.  PTAPE_PTAPE4 = 1;   KBIPE_KBIPE4 = 1;    KBISC_KBIE   = 1;    KBISC_KBIMOD   = 0;    KBISC_KBEDG4   = 0;   void interrupt 3 It_BP(void){    if  (KBISC_KBF == 1)   {      KBISC_KBIE  = 0;      KBISC_KBACK  = 1;                                                *  ==>     I send here a tempo of 30 ms.     And call after the following function.     }   } // end of It_BPvoid ihmTraiterTempoValidationBP(void){   *  ==> Button pressed<=> ihmEtatBP = TRUE;    if( ihmEtatBP != drvIhmTesterEtatLAB())    {                          KBISC_KBIE = 1;               if (ihmEtatBP == TRUE)      {           ihmEtatBP = FALSE;      }      else      {        ihmEtatBP = TRUE;      }            }} // end of ihmTraiterTempoValidationBP

 



--
Alban Edit: Please include FSL Part Number in all Message Subjects line.



Message Edited by Alban on 2007-08-01 08:07 PM
Labels (1)
0 Kudos
Reply
3 Replies

456 Views
bigmac
Specialist III
Hello,
 
It is not entirely clear what you are hoping to achieve.  You appear to have set up the KBI module so that PTA4 should cause an interrupt to occur on a negative edge, presumably when the button is pressed.  It then seems you intend to disable the KBI interrupt (for a period of 30ms ??).  Whether or not you would get a further interrupt when the button is released would depend on KBI interrupt being re-enabled, and whether there was any contact bounce on release.  If no bounce, no interrupt since a negative edge remains selected.
 
However, there seems to be another problem with your posted code - should not the KBI module use vector 22, rather than vector 3?
 
Regards,
Mac
 
0 Kudos
Reply

456 Views
sm
Contributor I
Hello,

I maintain, Interrupt vector is the 3rd.

I treat the bounce(100 ms), but I do not inverse the polarity with KBISC_KBEDG.

1 interrupt on 10 do not rise.

...


0 Kudos
Reply

456 Views
Alban
Senior Contributor II
Hello,

Interrupts are numbered from the top address of 0xFFFF.
Vector 3 is LVD.

Cheers,
Alban.
0 Kudos
Reply