I am trying to run the basic KBI function on processor expert. I use DEMO9S08LL16 demo board. The goal is to make the variable "state" increase 1 when KBI activated every time. I use PTA pin 7 for KBI. However, I got cpu_interrupt when I push the button (KBI activate) in the first time. I could not figure out what happen. Please advice.
I attached my code in the attachement.