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.

LAUNCHXL2-RM57L: read/count external digital pulses every 10 microseconds

Part Number: LAUNCHXL2-RM57L
Other Parts Discussed in Thread: RM57L843, HALCOGEN

I have bought a Hercules Launchpad RM57Lx MCU and I need to read/count external digital pulses every 10 microseconds. How can that be done?

  • Hello,
    RM57L843 has N2HET timer. The N2HET is a specialized micro-machine with its own instruction set. There are instructions that you can use for counting edges, measuring pulse widths and measuring periods.

    Also, the HALCoGen utility creates a default N2HET program which it programs into the N2HET memory based on the configuration you make using the GUI. This supports up to 8 PWM outputs, up to 8 edge counters, and up to 8 input signal period captures.
    The edgeGetCounter reads the data field of the edge counter (ECNT) instruction for the edge number you provide (from 0 to 7 supported by the default program).
    The getGetTimeStamp reads the data field of the one WCAP instruction provided in the default N2HET program. I see that the GUI does not offer any capability of configuring this instruction.

    Please take a look at this TI design as well: www.ti.com/.../tidua43.pdf


    Best regards,
    Miro

  • Hey, Miro!
    Thanks for replying, it was helpful.

    May you give a simpler example for the edgeGetCounter function and counting the pulses? I use HALCoGen and CCS and I am, kind of, a beginner.

    By the way, what software is being used in the example link you mentioned above for HSC/PTO? I was not able to understand completely.

    Thanks and regards,
    Apurv
  • Hello,
    Please take a look at this thread about example of using edgeGetCounter and setting HALCoGen:
    e2e.ti.com/.../339601

    The best way to program HET module is HET IDE. The High End Timer Integrated Development Environment (HET IDE) is a windows based application that provides an easy way to get started developing and debugging code for the HET ( http://www.ti.com/tool/HET_IDE ).

    When you install the HET IDE, tutorials will be installed as well. Also there is Standard Input Examples under Edit->Insert Algorithm menu.
    Here is HET IDE Tutorials User guide: www.ti.com/.../spnu485c.pdf

    ECNT (Event Count) is the instruction which can be used . All instructions are described in Chapter 23 as well HET Module.

    Best regards,

    Miro