Sebastian Mojado

Using KBI to get out of the STOP-Mode with HC08QY4A. Problems with understanding of KBIPR.

Discussion created by Sebastian Mojado on Mar 6, 2007
Latest reply on Mar 6, 2007 by Sebastian Mojado
Im using a HC08QY4A.

I try to use the KBI to get out of the STOP-Mode.

PTA2, PTA3, PTA4 or PTA5 should awake the controller.

See: http://img59.imageshack.us/img59/4584/belegunginlinoswka7.png

-> PTA2, PTA3 & PTA5 are high (because of the internal pullup) and getting low, if a button is pressed. If one of these ports are low, the controller should get out of the STOP-Modus.

-> PTA4 should be low and getting high if the transistor switches. If PTA4 gets high, the controller should get out of the STOP-Modus.

PTA0&PTA1 are used for PWM-generating.


I tried this code:
/*******************/

KBSCR_MODEK = 0;

/* I enable the KBI-pins (PTA2-PTA5)
KBIPR: KBIE5=1,KBIE4=1,KBIE3=1,KBIE2=1*/
KBSCR_KBIER = 0x3C;


// AND NOW THE PART I DO NOT UNDERSTAND
// The polarity of PTA2,3,5 is falling edge ?
// The polarity of PTA4 is rising edge ?
KBIPR: KBIE5=0,KBIE4=1,KBIE3=0,KBIE2=0 */
KBSCR_KBIPR = 0x10;

/*******************/

Indeed if I press one of PTA2, PTA3 or PTA5 the controller gets out of the STOP and continues in the KBI_Interrupt-ISR.
BUT no reaction with PTA4 and its button!

My Questions:
- Is it possible to get out of the STOP-Mode with the KBI and these wiring? What I am doing wrong? I have difficulties to understand the function of the KBIPR-register.


Thanks a lot (and excuse my bad English)
Sebastian



---
http://www.freescale.com/files/microcontrollers/doc/data_sheet/MC68HC908QY4A.pdf

Outcomes