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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,885 次查看
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 项奖励
回复
1 解答
1,308 次查看
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 项奖励
回复
4 回复数
1,309 次查看
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 项奖励
回复
1,308 次查看
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 项奖励
回复
1,308 次查看
mjbcswitzerland
Specialist V

Hi

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

Regards

Mark

0 项奖励
回复
1,308 次查看
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 项奖励
回复