How to Set System Clock Gating Control Register GPIO for freedom MKE06z?

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

How to Set System Clock Gating Control Register GPIO for freedom MKE06z?

Jump to solution
1,498 Views
jefersonip
Contributor III

I did not find in the documentation of this microcontroller setting the System Clock Gating Control Register for GPIO,

Can someone help me.

Thanks,

0 Kudos
1 Solution
921 Views
mjbcswitzerland
Specialist V

Hi

There is no clock gating register for GPIO in the KE parts. That is, there is nothing that needs to be done before using the GPIO.

Regards

Mark

View solution in original post

0 Kudos
4 Replies
922 Views
mjbcswitzerland
Specialist V

Hi

There is no clock gating register for GPIO in the KE parts. That is, there is nothing that needs to be done before using the GPIO.

Regards

Mark

0 Kudos
921 Views
tomsparks
Contributor III

It appears that the the KEA series needs no special clock configuration for the GPIO either.  I have not found anything in the reference manual that let's a person select a clock to the port for using GPIO on a particular pin. It apparently just needs the GPIOx_ registers configured.  Can you confirm whether this really is the case for the KEA series as well?

0 Kudos
921 Views
mjbcswitzerland
Specialist V

Hi

KEA and KE are equivalent in many ways - GPIOs are always clocked.

Regards

Mark

0 Kudos
921 Views
jefersonip
Contributor III

Thank you, you are correct.

Test the code below and it worked.

#include "MKE06Z4.h"

// GPIOB/FGPIOB pins 21, 22, 23

#define LED_C_RED 0x200000

#define LED_C_GREEN 0x400000

#define LED_C_BLUE 0x800000

int i = 0, j = 0;

int main(void)

{

  // Configure with output direct

  FGPIOB->PDDR |= LED_C_RED | LED_C_GREEN | LED_C_BLUE;

  // Set all leds with off

  FGPIOB->PDOR |= LED_C_RED | LED_C_GREEN | LED_C_BLUE;

    for (;;) {

    // Port toggle output

    FGPIOB->PTOR |= LED_C_RED;

    for(i = 0; i < 30000; i++){

    for(j = 0; j < 100; j++);

    }

    }

    return 0;

}

Merry Christmas!!!

0 Kudos