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,888件の閲覧回数
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,

ラベル(2)
0 件の賞賛
返信
1 解決策
1,311件の閲覧回数
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,312件の閲覧回数
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,311件の閲覧回数
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,311件の閲覧回数
mjbcswitzerland
Specialist V

Hi

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

Regards

Mark

0 件の賞賛
返信
1,311件の閲覧回数
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 件の賞賛
返信