Loading ...
Sorry, an error occurred while loading the content.

281Re: HET instructions help

Expand Messages
  • Steven L
    Mar 1, 2010
    • 0 Attachment
      --- In TMS470_ARM@yahoogroups.com, Rakesh Kumar <rakesh.kumar58@...> wrote:
      > what is the use of conditional address in ECNT instruction?
      > what does MOV32 instruction do?
      > can anyone please explain me the above two instructions with a small example..

      Hi Rakesh,

      The ECNT's cond_addr field is the address in your HET program for execution to branch when the condition you are counting occurs. It is the same type address as the 'next' field which is where execution goes each time the execution loop performs the ECNT instruction without an active event.

      For example, if you have an ECNT instruction to count the times a pin has a rising edge, the 'next' address will be the next instruction performed each time the HET execution loop leaves the ECNT instruction and the pin did not have a rising edge compared to the last time the instruction was executed. If the pin did have a rising edge since this ECNT was last executed, the HET execution will leave the ECNT and branch to the 'cond_addr' instruction label. Edges are always compared to the pin value the last time this instruction was executed.

      If you do not have any particular reason for branching different places based on the ECNT's event status, just make both addresses the same. In this little example from my code, I am monitoring a sprayer's arm rotation sensor. Since I am only counting the rotations and read it asynchronously from the external software, I have the next and cond_addr both going the same place. If I wanted something different to happen when the count edge was detected, I would place a different destination address in the cond_addr field.

      ArmRotation: ECNT
      next = BeeperControl
      cond_addr = BeeperControl
      pin = CC22
      event = RISE
      control = ON
      reg = none
      irq = OFF
      data = 0

      I have never used the MOV32 instruction, so I can't help with that.

      Hope this helps,
    • Show all 3 messages in this topic