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.

SM470R1B1M HET used for counting pulses every half second

Other Parts Discussed in Thread: TMS470R1B1M, HALCOGEN

Hi,

I am usign SM470R1B1M which is the High Temperatrure version of TMS470R1B1M. I am trying to use HET for counting pulses(not high frequency) every half second. I have questions and confusion as below:

1. As I think, ECNT instruction can be used for this application. Is it correct?

2. Once I put the instrution in the HET RAM. I have to read the pluses number every half second in my normal loop program. How to do it? From the HET document, it is said we can read the value( data field stored in the HET RAM) though shadow register0 and shadow register1. But I cannot find these two registers' definition in the IAR files.

3. Every half second, after I read the pulse number. The data field of ECNT in the HET RAM must be cleared. How to do it?

Thanks all for your help,

Qi

  • Hi Qi Tang,

    1. As I think, ECNT instruction can be used for this application. Is it correct?

    You can use ECNT for Input Edge counting or you can use PCNT for Input Pulse measurements. I would suggest you, if you have not done already, to install the latest version of HET IDE. With this tool you can use already defined HET algorithms for the most common operations and extend them as you want. Furthermore you are able to simulate the HET code and get appropriate waveforms. In HET IDE => Edit => Insert Algorithm => Standard Input Examples you can find the above mentioned instructions used for Input Edge counting and Input Pulse measurements.

    Link to HET IDE download: http://www.ti.com/tool/het_ide

    2. Shadow Registers

    I do not know how it is using IAR IDE. In the generated code using HALCoGen the drivers allow access to the HET RAM by calling the "edgeGetCounter" function.

    with

    #define hetRAM ((hetRAMBASE_t *)0xFF460000U)

    typedef volatile struct hetRamBase
    {
                 hetINSTRUCTION_t Instruction[128U];
    } hetRAMBASE_t;

    typedef volatile struct hetInstructionBase
    {
         unsigned Program;
         unsigned Control;
         unsigned Data;
         unsigned : 32U;
     } hetINSTRUCTION_t;


    Maybe there is somthing similar to this in the IAR files? Link to latest version of HALCoGen

    http://www.ti.com/tool/halcogen

    3.  Data field of ECNT in the HET RAM must be cleared

    The HET provides a feature allowing to automatically clear the data field after a 64-bit read operation of the control and data fields. This feature is implemented via the control bit, which is located in the control field (bit C21). This is a static bit that can be used by any instruction. See TMS470M TRM section 12.3.1.3.

    Best Regards,

    Gregor Fleischhauer

     

  • This is great and quick support.

    Thanks a lot, Gregor.