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.

HET CNT question / HET source code for HalCoGen blackbox driver

Other Parts Discussed in Thread: HALCOGEN

I need to program my own HET code. I have read application node SPRABA0B and have a basic understanding about the PWM example there.

Now I need to code the free running timer from the HalCoGen blackbox driver, which is used in hetResetTimestamp() and hetGetTimestamp() in het.c

I guess the corresponding HET program for this is:

    /* CNT: Timebase
    *       - Instruction                  = 0
    *       - Next instruction             = 1
    *       - Conditional next instruction = na
    *       - Interrupt                    = na
    *       - Pin                          = na
    *       - Reg                          = T
    */
    {
        /* Program */
        0x00002C80U,
        /* Control */
        0x01FFFFFFU,
        /* Data */
        0xFFFFFF80U,
        /* Reserved */
        0x00000000U
    },

and

    /* WCAP: Capture timestamp
    *         - Instruction                  = 57
    *         - Next instruction             = 0
    *         - Conditional next instruction = 0
    *         - Interrupt                    = na
    *         - Pin                          = na
    *         - Reg                          = T
    */
    {
        /* Program */
        0x00001600U,
        /* Control */
        (0x00000004U),
        /* Data */
        0x00000000U,
        /* Reserved */
        0x00000000U
    },

Could someone from TI translate that into the HET assembler code? Or is the HET assembler code from the blackbox driver available to look into?

Thank you very much.

  • Tom,

    Give this a try:

    START   CNT  { reg=T,comp=EQ,max=1FFFFFFh,data=1FFFFFFh};
    L1      WCAP { pin=0,event=NOCOND,reg=T,data=0,cond_addr=START, next=START};

    This is the output I get from the HETP code:

      /* START_0 */
     {
      0x00002C80,
      0x01FFFFFF,
      0xFFFFFF80,
      0x00000000
     },

      /* L1_0 */
     {
      0x00001600,
      0x00000004,
      0x00000000,
      0x00000000
     },

    However, I don't understand the purpose of this code (the event=NOCOND part).

    If you haven't tried the HET IDE yet, I'd strongly suggest this as you can see much more of what's happening in the simulation environment vs. silicon.

    There is also a widget called "Insert Instruction" (looks like 2 I-beams) and this gives you a template for each instruction so helps you code without syntax errors.  Additionally there are 'Insert Algorithm' and "Insert PWM" tools that you can use.

    Best Regards,

    -Anthony

  • Anthony,

    thanks, I tried this and it worked as expected. I looked also in the HET IDE and found a lot of new information there. Beginning to like the power one can get by programming the HET.

    Best regards,

    Tom