0

When using the ESP-IDF, there are the LEDC-drivers. Basically, you initialize a timer and a channel, so a matching PWM for your LED is the result.

ledc_channel_config_t.hpoint
ledc_set_duty_with_hpoint(...)

The hpoint parameter comes up a lot of times and most I could find all over the search engines was: keep it at zero.

So what does this hpoint-parameter stand for?

1 Answer 1

2

A few hours later I finally found a resource explaining this - so I thought: might make it a bit more accessible...

Source: https://circuitlabs.net/led-pwm-controller-ledc-of-esp32/

Hpoint (Horizontal Point / Phase Control): Each channel has an hpoint register. This value determines the phase of the PWM signal by defining the timer count value at which the duty cycle begins. For most simple LED dimming, hpoint is set to 0. By using different hpoint values for channels sharing the same timer, you can create phase-shifted PWM signals.

self-answer: hpoint is the phase offset of this channel in the same resolution as the pwm itself.

So, it ranges from [0..2^DUTY_BITS-1]

1
  • 1
    I wanted to add that hpoint (LEDC_HPOINT_HSCHn) is described in the official technical reference manual. Not that it shows well in search results or is particularly accessible. Just that it is not missing entirely. One of the diagrams in the article is from it. It is sometimes good to consult in parallel with articles like these. The "H" probably stands for "high". "hpoint" being something like like "high-level comparator output latch point". But, "horizontal" might serve thinking better anyway. Commented Nov 16 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.