AnsweredAssumed Answered

Problem with code for KL25Z32VFM4 PWM and wake up timer

Question asked by Amreen Sayyed on Jun 6, 2014
Latest reply on Jun 7, 2014 by Amreen Sayyed

Hello All,

 

I am working with code worrier 10.3.

I have created code using processor expert.

In my code there are 3 configuration settings

Config 0- PEE mode (External Crystal)

Config 1 –FEE mode (Internal crystal)

Config 2 – BLPI mode (Internal crystal)

 

But I have written code for PWM, Wake up timer by myself (from reference of processor expert generated code for PWM and wake up timer)

 

I am using Wake up timer to wake up from LLS mode.

Also PWM to generate pulses at PTB0 pin

 

All above setting I have done for FRDM KL25Z128VLK4 Controller.

And it’s working Fine. I can wake up from LLS mode and Pulses are there at PTB0 pin.

 

Now I want to use KL25Z32VFM4. I have made all above same setting for this controller.

I have checked LED blinking, UART and Timer 2 (Code is same as that of KL25Z128VLK4) with this controller. Its working.

 

Before building the program need to update” vector.c” as

1)Need to add hex file of LPTMR interrupt and need to call TMR_IRQ_handler  from Vector table.

 

  1. But Code for PWM at pin PTB0 And wake up timer To wake up from LLS mode is Not working with this KL25Z32VFM4.

 

I have attached both the codes.

“Test_Code_KL25Z80pin” – Code for KL25Z128VLK4 –its working.

“Test_Code_KL25Z80pin” – Code for KL25Z32VFM4 – its not working.

 

  1. In code for KL25Z32VFM4 before executing main application of mine it is going into hard Fault.

It is going into hard fault at the definition of PORT D pin  PTD 4 which I am using as a LLWU pin to wake up from Low power mode.

To overcome out off this I added a line in “ CPU.c “ file as

SIM_SCGC5 |= SIM_SCGC5_PORTD_MASK; before PTD4 mux setting in “ PE_low_level_init” function.

And it is working I am not getting why there is a problem as Same setting works fine for KL25Z128 controller.

 

Please help me in these 2 questions guide me where I am getting wrong.

 

regards,

Amreen

Original Attachment has been moved to: Test_Code_KL25Z32pin.rar

Original Attachment has been moved to: Test_Code_KL25Z80pin.rar

Outcomes