This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRA821U: PWM signal sample abnormal

Part Number: DRA821U

Hi

I used ICU model to sample PWM signal. It works perfect in the most of time, however, the sample result turns a 30% deviation when the sampled signal keeping the same.

The sample result soon became normal in next 2 or 3 sample cycle.

I use the ICU in a 10ms period task to get the sample result and report it in a 50ms period

below image shows the change of sampled PWM frequency. It sample a stable pwm signal with 100hz. vertical axis stand for frequency while horizontal stand for time.

my ICU configure is as below:

/* Icu Channel Configuration parameters */
ICU_CONFIG_DATA_SECTION CONST(struct Icu_ConfigType_s, ICU_CONFIG_DATA)
     IcuConfigSet =
{
    .icuMaxChannel = 2U,
    .chCfg =
    {
        [0] =
        {
            .defaultStartEdge = ICU_FALLING_EDGE,/* Default start edge*/
            .measurementMode = ICU_MODE_SIGNAL_MEASUREMENT,/* Measurement Mode*/
            .signalMeasurementProperty = ICU_PERIOD_TIME,
            .instanceClkMHz = 12500U,
            .prescaler = 0, /* prescale */
        },
        [1] =
        {
            .defaultStartEdge = ICU_FALLING_EDGE,/* Default start edge*/
            .measurementMode = ICU_MODE_SIGNAL_MEASUREMENT,/* Measurement Mode*/
            .signalMeasurementProperty = ICU_PERIOD_TIME,
            .instanceClkMHz = 12500U,
            .prescaler = 0, /* prescale */
        }
    },
};
  • Hello,

    To clarify, you are running a 100Hz PWM signal and sampling it with the ICU. The signal looks to run at 100Hz (~102 Hz). Have you checked this signal with an oscilloscope to confirm it is behaving as expected? Wondering why the frequency seems to drop after the ICU samples ~67Hz and then goes back up again.


    Initially, I don't see an immediate issue with your ICU configuration.

    Regards,

    Erick

  • Hi Erick

    I have confirmed the signal is behaving as expected with oscilloscope at soc input side....