How write a function which change frequency every 100hz by using sw2 and sw3 buttons? nxps32k144evb

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

How write a function which change frequency every 100hz by using sw2 and sw3 buttons? nxps32k144evb

Jump to solution
6,103 Views
miketorres
Contributor II

Hi,

 

I have program from example application - ftm_pwm_s32k144. I set frequency at 1000HZ in flexTimer. I would like to change frequency every 100HZ by using Sw2 and SW3 buttons. How Can i do it? I defined in my program this buttons and what should I do next? Could you help me, do you have similar code or advice?

Regards

Mike 

0 Kudos
Reply
1 Solution
6,042 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@miketorres

      I have answered you under your other questions.

BR!

     Jim,

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

3 Replies
6,091 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@miketorres

Hi, Mike

I give you a hint.

1.How to change PWM frequency?

please refer to example "ftm_signal_measurement_s32k144 "

 

2.How to use SW1 or SW2.

please refer to example "power_mode_switch_s32k144"

In this example,SW3 was used to wake up the CPU from power mode.

/* Interrupt service routine for SW3 */
void ButtonISR(void)
{
    /* Clear button IRQ flag */
    PINS_DRV_ClearPortIntFlagCmd(PORTC);
}

or you just keep reading SW(I/O) status without using interrupt. 

pins_channel_type_t PINS_DRV_ReadPins(const GPIO_Type * const base)

 

BR!

     Jim,

0 Kudos
Reply
6,063 Views
miketorres
Contributor II

Hi,

 

what's wrong with this code? Could you help me? Where are mistakes? I don't understand. I would like to this code generate digital square signal - 1000hz frequency. By using sw2 and sw3 buttons I would like to change frequency. If I pushed once for example sw2 button frequency should increase about 100HZ. Could you correct my mistake in this code? I will be very grateful. 

0 Kudos
Reply
6,043 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@miketorres

      I have answered you under your other questions.

BR!

     Jim,

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

An error has occurred when reading existing sub-variable "Language_PG_Configuration"; see cause exception! The type of the containing value was: extended_hash+string (lithium.coreapi.webui.template.models.NamedValueByNameTemplateModel wrapped into f.e.b.StringModel) ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign redirect_lingo_page_url = web... [in template "language_macro_header.ftl" at line 173, column 1] - Reached through: #include "language_macro_header.ftl" [in template "Language_translator_Dashboard" at line 3, column 1] ----