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

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

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

1,688 Views
mojo
Contributor I
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
Labels (1)
0 Kudos
3 Replies

315 Views
bigmac
Specialist III
Hello Sebastian,
 
I can see no particular problem with your KBI setup.  PTA4 should interrupt on the rising edge.  However, the other buttons should all be inactive for this to occur.
 
I assume you are actually using a QY4A device for your tests.  If you were to use an earlier QY4 device, the KBIPR register is not present, and a positive edge cannot be selected.  This was one of the enhancements for the A-suffix device.
 
Regards,
Mac
 
 
0 Kudos

315 Views
mojo
Contributor I
Mighty Gods of 8-Bit-Controllers!
Thank you both for helping me!

Bigmac, you solved my problem. There is indeed a 908QY4 (instead of a 908QY4A) solded on the HW. With a 908QY4A everything works fine now.
0 Kudos

315 Views
peg
Senior Contributor IV
Hi mojo,
 
Without looking too deeply on my part I suggest your problem may be like this:
 
 
0 Kudos