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.

TMDX570LC43HDK: Het pwm to produce variable delay between 10us and 40ms in steps of 10us

Part Number: TMDX570LC43HDK
Other Parts Discussed in Thread: HALCOGEN

Hy,

I would like to use n2het1 pwm interrupt feature to create a low to high transition and interrupt after a variable delay,

so, the delay could be setted by code using for example the following instructions:

    hetSIGNAL_t pwm0_signal;
    pwm0_signal.duty = 50;
    pwm0_signal.period = 5000000; /*in usecs*/
    pwmSetSignal(hetRAM1,pwm0,pwm0_signal);
    pwmStart(hetRAM1, pwm0);

my problem is that the delay I need to set is between 10us and 40ms in steps of 10us,

so basically I need about 40ms/10us = 4000 possible values of delay,

I've tried to set looptime = 40ms but it seems that "Actual LR Time" doesn't change if I set Loop Time = 4ms instead of 40ms,

maybe there's a saturation problem somewhere?

Do you think I can use het to produce such variable delay (between 10us and 40ms in steps of 10us)

Thanks for your help,

Antonio

  • Hi Antonio,

    I've forwarded your question to our NHET expert. They should be able to provide you some guidance on this topic soon.
  • at the end we reduced our range to variable delays in the range 50us <-> 5ms


    with the following setting in Halcogen it is almost ok

    in fact instead of       50uS I've 50.037uS     and    instead of        50000uS I've 50000.011uS

    now I'm a little bit confused about the HalCoGen Settings and freertos privileges, in fact using the following setting I've notification unneeded

        

    in fact I don't want notification before of this code

        hetSIGNAL_t pwm0_signal;
        pwm0_signal.duty = 20;
        pwm0_signal.period = 900; //uS
        pwmSetSignal(hetRAM1, pwm0, pwm0_signal);
        pwmStart(hetRAM1, pwm0);

    instead I've notification immediately after hetInit() ,

    if I disable the pwm interrupt Eof Period 0 or disable pin 0 in the first figure above I've no more notification but it is no possible to enable notification in user mode in freeRTOS using pwmEnableNotification (hetREG1, pwm0, pwmEND_OF_PERIOD)

    maybe due that in FreeRTOS I'm in user mode not supervisor and I don't if is possible or not to switch to supervisor mode to enable it, this is my question,

    or also how can I obtain the result to start a pwm at runtime in user mode.

    I'm using HalCoGen 4.06.

    Thanks

    Antonio