LyraT 4.3 - need three PWM GPIOs, but they behave weirdly

tamhan
Posts: 8
Joined: Tue May 19, 2020 7:22 pm

LyraT 4.3 - need three PWM GPIOs, but they behave weirdly

Postby tamhan » Tue May 16, 2023 8:01 pm

Esteemed Quorum,
a small question: for an application, we would like to generate PWM output from a ADF pipeline object. Our hardware is a LyraT 4.3, we use IDF version 4.4. All jumper settings are set to enable JTAG on the JTAG connector.

The initialization is done like so:

Code: Select all

#define LEDC_GPIO 14
ledc_channel_config_t ledc_channel;

static void init_wefz(void)
{
    ledc_timer_config_t ledc_timer = {
        .duty_resolution = 8, // was LEDC_TIMER_10_BIT
        .freq_hz = 8000,
        .speed_mode = LEDC_HIGH_SPEED_MODE,
        .timer_num = LEDC_TIMER_0,
        .clk_cfg = LEDC_AUTO_CLK,
    };

    ledc_timer_config(&ledc_timer);
    ledc_channel.channel = LEDC_CHANNEL_0;
    ledc_channel.duty = 0;
    ledc_channel.gpio_num = LEDC_GPIO;
    ledc_channel.speed_mode = LEDC_HIGH_SPEED_MODE;
    ledc_channel.hpoint = 0;
    ledc_channel.timer_sel = LEDC_TIMER_0;
    ledc_channel_config(&ledc_channel);
}
Inside the pipeline, we write the new values in like so:

Code: Select all

    ledc_set_duty(ledc_channel.speed_mode, ledc_channel.channel, setB);
    ledc_update_duty(ledc_channel.speed_mode, ledc_channel.channel);
Sadly, the program behaves weirdly. The PWM output works for like three to six seconds and tracks changes, but then stops for three to six seconds.

Could it be that the JTAG engine somehow "blocks" the GPIO pins? If yes, can you maybe suggest a setting in the menuconfig?

If not, are there three "free" GPIO pins on the LyraT which I could use for PWM? I, sadly, do need the I2C bus...

tamhan
Posts: 8
Joined: Tue May 19, 2020 7:22 pm

Re: LyraT 4.3 - need three PWM GPIOs, but they behave weirdly

Postby tamhan » Sat Aug 05, 2023 4:07 pm

Hello,
to report in: it now works perfectly. We had an issue in our algorithm which caused ZERO to be output at the PWM for some time, causing the behavior.

My apologies.

Who is online

Users browsing this forum: No registered users and 57 guests