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.

SineWaveGenerationUsingPWMWithHercules™︎N2HET andHTU----指导文档请教!



各位

好!

SineWaveGenerationUsingPWMWithHercules™N2HET
andHTU 指导文档中的方法 HTU 响应不了,请问指导文档哪个地方错了!

  • whong,

       您好!看到您在论坛里发的帖子,通过利用CNT指令中断定时实现了吗?想请教一下,通过配置,我的没有进入中断,不知道怎么回事。使能了HETlevel0.

  • 你有什么需求说说吧 我够呛能帮到你   

  • 上面是我的QQ,方便的话加一下交流下吧,我基本功能也调通了。我也想实现CNT实现定时功能,将data域改为0了,使能了HET level0,主程序里也enable中断那句话了,但没有进入中断,不知道哪里出的问题?还需要哪些配置?

  • Ray,

    您好!

    附件是很久之前用HET和HTU做的demo例程,看能不能帮到你,谢谢!

  • 各位,关于HTU,另外参考下这个问文档,还不错:

    http://www.ti.com/apps/docs/litabsmultiplefilelist.tsp?literatureNumber=spna130a&docCategoryId=1&appId=209&keyMatch=spna130a&tisearch=Search-EN-Everything 

    Leveraging the High-End Timer Transfer Unit on Hercules ARM Safety MCUs (Rev. A)

    This application report shows how the high-end timer transfer unit (HTU), a local DMA on the TMS570 and RM4x devices that is dedicated to the extremely versatile programmable timer co-processor (NHET), can be used to offload tasks from the main CPU by doing transfers between the main memory and the NHET. It shows how to set up the HTU, covers specific details that need to be taken into account when using the HTU, and lists the benefits of using HTU for data transfers instead of the CPU.

  • 请问

    看这个程序 中temp=(int32_t)(avrg-31)*640000/4020;  

    640000    4020  是怎么得来的

     谢谢

  • uint32_t filter(unsigned int input) //SW for filter algorithm, arithmetic average filter
    {

    uint32_t count;
    uint32_t avrg;
    int32_t avrg_temp;
    int32_t temp;
    // double pwm_duty;
    sum = sum -ADC_Buffer[0]+ input;
    for(count=0;count<(N-1);count++)
    {
    ADC_Buffer[count]=ADC_Buffer[count+1];
    }
    ADC_Buffer[9]=input;
    avrg=(uint32_t)(sum/N);
    if(avrg<31) avrg=31;
    // pwm_duty=(double)((avrg-31)*640000/4020);
    // temp=(uint32_t)(avrg/26)*pwm_interval;
    temp=(int32_t)(avrg-31)*640000/4020;
    return temp;
    }

    这个滤波函数里的。

    这个滤波算法你看懂了没,只取最近的十次。也就是先进的先丢弃。

    最新的十个数相加然后平均值。

    该平均值保证最小为31,

    高于31的部分。

    可是这个31是什么?

    get pwm duty circle number

    这个周期数是啥,应该跟这个设备的使用无关的一个东西,楼主不用管他这个算法是干啥的。