How do I clock all port pins in MKE02Z64VLD2 controller using kinetis design studio IDE ?

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

How do I clock all port pins in MKE02Z64VLD2 controller using kinetis design studio IDE ?

699 Views
ganeshramachand
Contributor IV

I need to clock all port pins in my MKE02Z64VLD2 Controller. What is the Syntax to clock all port pins in a freescale's KE-02Z series controller ?

What I have tried:

SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK |

SIM_SCGC5_PORTB_MASK |

SIM_SCGC5_PORTC_MASK |

SIM_SCGC5_PORTD_MASK |

SIM_SCGC5_PORTE_MASK;

I found this from a tutorial for a KL-25Z controller. But this throws me a syntax error. Since I am a beginner to embedded C coding, I couldn't find the specific syntax for the controller (KE-02Z) which I use.

Labels (1)
0 Kudos
3 Replies

417 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Ganesh,

About the gpio clock , it is different between the KE series and KL .

For the KE02 chip , the clock of gpio is enable by default after reset , you can

directly use the GPIO.  For example , if you want configure the PTD1 output 0, you

can directly configure it as this :

  /* Configure pin as output */

  /* GPIOA_PDDR: PDD|=0x02000000 */

  GPIOA_PDDR |= GPIO_PDDR_PDD(0x02000000);

  /* Set initialization value */

  /* GPIOA_PDOR: PDO&=~0x02000000 */

  GPIOA_PDOR &= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x02000000));

Hope it helps


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

417 Views
ganeshramachand
Contributor IV

CLock and PUll up enable errors.jpg

From the answer, if clocking is done automatically after reset, then can I simply delete that code and start over with

/*Configure Pin as Input */

?????

0 Kudos

417 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

What about these code , i think they are not for kinetis E series.

In the Kineits E series ,there is needn't enable the GPIO clock , and there is no the register

of SIM_SCGC5 ..

It looks like these are PE generate code , please use the functions and code for

your chip.

After you configure the Processor Expert , click the generate code , then use these code.

Hope it helps

Alice

0 Kudos