TWRK53N512 PWM configuration without using PE

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

TWRK53N512 PWM configuration without using PE

1,566 Views
joséflores
Contributor II

Good afternoon:

Is there any way to set the PWM without using the Processor Expert?. If so, could you please guide me how to perform this configuration?. I´m working with TWRK53N512.

I will appreciate your help.

Best regards.

Tags (2)
9 Replies

792 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

You can get the PWM code here :

KINETIS Project Code

About the detail information please refer to :

Re: Re: Flex timer initialization for pwm generation on k53 is not working

Hope it helps


Have a great day,
Alice

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

792 Views
joséflores
Contributor II

Hello,

Thanks for your answer. I´m working with Code Warrior 10.6, and I saw some codes there, but, are them compatible with CW? or I have to install another softwer? I´m new using it, the utasker.

In the other post, I used the code there but I don´t have any signal on the pin, I really don´t know why. I will appreciate a little more your help.

Best Regards.

José

0 Kudos

792 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jose,

- If you use the uTasker code , you need first download the "uTaskerKInetis.zip" file , and then please refer to the "getting _started.txt"

to use it , and it support CW:

pastedImage_0.png

- And why you don't use the PE , i think it is convenient to refer to the generated code .

For example , after add the PWM component, then configure it , you can find the code , and also there

have demo code to refer to (right click the component , then select the help on component  ):

pastedImage_2.png

Hope it helps


Have a great day,
Alice

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

0 Kudos

792 Views
joséflores
Contributor II

Good afternoon Alice:

I think I didn't mention, but I have an app developed in CW MQX and I want to use the PWM in that app, that's why I didn't want to use the PE. I had tried it before but the problem is when I want to add the instructions. I tried copy-paste option, import-export, and nothing.

I've been trying to use the PE according to your comments but I have not succeeded, I think I have this problem according to what I'm doing .


1) I made a new MQX lite project, just for test, and using the processor expert of that project, the PWM worked.

2) According to your previous answer, I tried to do the same for the MQX project using the PE located in the bsp_twrk53n512 folder. I opened this PE, add the PWM_LDD component, set it up and generated the code.

4) For now, I created a new project in MQX, just for test again, to add the sample code shown in the help section of the PWM component, and in the paths and symbols option add the generated code folder, for libraries and other things I could need.

5) I build the project and no errors appear, but when I debug and run the project, it stock in the next line on Cpu.c file on Generated code folder:


while((MCG_S & MCG_S_LOCK_MASK) == 0x00U) { /* Wait until locked */

  }

 

Am I doing something wrong? or what I am missing? I hope my explanation has been clear.

Best regards.

José

0 Kudos

792 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

Please check the clock configuration , if you still can not fund the problem , you also can send your project to me , i check it on my side .

BR

Alice

0 Kudos

792 Views
joséflores
Contributor II

Good afternoon Alice:

I already did the clock configurations according to the MQX_Howto_Setup_Kinetis_Clock_UsingPE.pdf file. The last time, I forgot to build the bsp_twrk53n512 folder, where the PE is, but another error appears on dispatch.S file, line 449:

ASM_LABEL(no_one_to_run)

                /* woohoo, idle task must be enabled, this point cannot be reachable, you have serious problem */

                b .

Some time ago I had this error but I didn't know how to solve it. I send you my PWM_Test project and the bsp_twrk53n512 folder, I would appreciate if you could check them to see if I made something wrong.

Best regards.

José

0 Kudos

792 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jose,

Do you want add the PWM drive to the BSP of MQX, then in your MQX project to call the driver ?

If yes , sorry so far i don't know how to add the driver and utilize it , i will learn and then i will tell you if successful .

And i found one PWM code without PE, i think you can add it to your mqx project task , here :

Re: K60 FlexTimer (PWM) Example Code?

Hope it helps


Have a great day,

Alice

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

0 Kudos

792 Views
joséflores
Contributor II

Good morning Alice:

Sorry for not answering.

  • Do you want add the PWM drive to the BSP of MQX, then in your MQX project to call the driver?

Yes, that is exactly what I need, but you already answered to me. Actually the component that I need more is DAC0 but is the same problem than the PWM, it has no drivers on the bsp.

I was looking for another way to use the PE and I found the Enable Processor Expert for Existing C Project option. I used it and that allows me to add into my MQX project the PE, but I don´t know if the code generated with the PE is compatible with the tasks that I already have on the project, because I build it and the only file that runs is the the main.c created by PE. I was reading the next post:

Adding PEx to KDS bareboard project (without SDK) https://community.nxp.com/docs/DOC-102329/diff?secondVersionNumber=2" title="https://community.frees...

  • Remove the duplicate main.c module – the main_backup.c file (copy content of the old main.c module into the new one created by PEx) and delete the old version of the file (main_backup.c)

I would like to know if is the same procedure because I´m not using KDS, I tried to copy the content of the old main.c, but the next error appears:

C:/Freescale/Freescale_MQX_4_1/lib/twrk53n512.cw10gcc/debug/bsp/cm_kinetis.h conflicting types for 'TCpuClockConfiguration'

Do you have any idea what that error means?

The code of the tasks that I already have are compatible with the code generated by PE?

Or is there a way to join both codes?

Best regards.

José

0 Kudos

792 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Jose,

For the MQX,  it have one library , the PE have another lib , so i don't know whether i can work well on your project,

i recommend you can ask the author of   the DOC you fund , just ask under the doc commend you mention .

And im so sorry know little about the MQX driver ,  i think there will be people who know this well to help you .

BR

Alice

0 Kudos