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

TMS470. Interrupts on HET

Expand Messages
  • Антощенков Роман Викт
    Hello, everyone! Possible to handle interrupt on HET pins like on GIOA?? -- Best regards, Roman Antoshchenkov
    Message 1 of 5 , Mar 3, 2008
    • 0 Attachment
      Hello, everyone!

      Possible to handle interrupt on HET pins like on GIOA??


      --
      Best regards,
      Roman Antoshchenkov mailto:djantoxa@...
    • hammond_sp
      Howdy, I ve done some work with the HET and have configured it for this purpose. If you look in the HET documentation you ll see that some of the instruction,
      Message 2 of 5 , Mar 3, 2008
      • 0 Attachment
        Howdy,

        I've done some work with the HET and have configured it for this
        purpose. If you look in the HET documentation you'll see that some of
        the instruction, such as ECMP, have an option called IRQ. When this
        is turned on, and interrupt will fire if some condition is met. This
        is an example of HET assembly I've written for it:

        L01: ECMP {next=L00, reg=A, hr_lr=LOW, pin=0x12, action=PULSELO,
        irq=ON, data=3}

        This fires an interrupt whenever the value in register A is equal to 3.

        Also, some other registers need to updated to allow interrupts, such
        as the REQMASK (found in the system module reference guide), and the
        HETPRY to make sure you're interrupts are the correct priority.

        This is how I handled the interrupt, which may be different for
        different configurations of the HET/IRQ configurations:

        __irq __arm void irq_handler(void)
        {
        switch((0xff & IRQIVEC)-1)
        {
        case CIM_COMP1 : COMP1_irq_handler(); break;
        case CIM_HET1 : HETIRQ(); break;
        }
        }

        This would run HETIRQ() on HET interrupts, the HETIRQ() function would
        have to take care of cleaning up and resetting the interrupt registers
        before returning to normal operation.

        I hope this helps get you started,
        hammond

        --- In TMS470_ARM@yahoogroups.com, Àíòîùåíêîâ Ðîìàí Âèêòîðîâè÷
        <djantoxa@...> wrote:
        >
        > Hello, everyone!
        >
        > Possible to handle interrupt on HET pins like on GIOA??
        >
        >
        > --
        > Best regards,
        > Roman Antoshchenkov mailto:djantoxa@...
        >
      • Антощенков Роман Викт
        Hello, hammond_sp. ... I using code like this: L00: ECNT {next=L01, irq=ON, event=FALL, pin=CC6, data=0x0} L01: BR {next=L00, cond_addr=L00, event=NOCOND} Is
        Message 3 of 5 , Mar 3, 2008
        • 0 Attachment
          Hello, hammond_sp.


          > Howdy,

          > I've done some work with the HET and have configured it for this
          > purpose. If you look in the HET documentation you'll see that some of
          > the instruction, such as ECMP, have an option called IRQ. When this
          > is turned on, and interrupt will fire if some condition is met. This
          > is an example of HET assembly I've written for it:

          > L01: ECMP {next=L00, reg=A, hr_lr=LOW, pin=0x12, action=PULSELO,
          > irq=ON, data=3}

          I using code like this:

          L00: ECNT {next=L01, irq=ON, event=FALL, pin=CC6, data=0x0}
          L01: BR {next=L00, cond_addr=L00, event=NOCOND}

          Is it correct?

          --
          С уважением,
          Антощенков mailto:djantoxa@...
        • Антощенков Роман Викт
          Hello! I think it can be usefull for beginners: //****************************************************************************** // Initialize HET
          Message 4 of 5 , Mar 4, 2008
          • 0 Attachment
            Hello!

            I think it can be usefull for beginners:

            //******************************************************************************
            // Initialize HET
            //******************************************************************************
            __disable_interrupt(); // Disable interrupts

            //
            HETGCR = CLK_MASTER + IGNORE_SUSPEND; // HET Master Mode, Ignore SW BP
            MemCopy32((void *) &e_HETPROGRAM0_UN, (void *) HET_INIT0_PST,
            sizeof(HET_INIT0_PST)); // copy HET program to memory
            HETPFR = 0x00000309; // Set PFR register /8 /10
            HETPRY = 0xFF; // Set priority for HET interrupt
            HETDIR = 0x1; // Set Pin 1 (HET0) to output, rest HET pins to input
            //

            REQMASK = (1 << CIM_HET1); // Enable interrupts HET1
            __enable_interrupt(); // Enable interrupts

            HETGCR |= ON; // Start HET

            //******************************************************************************
            // MAIN INTERRUPT HANDLER
            //******************************************************************************
            #pragma vector=IRQV /* IRQ vector address */
            __irq __arm void irq_handler(void) {
            switch ((0xff & IRQIVEC)-1)
            {
            case CIM_HET1:
            HET1_irq_handler(); // Call HET interrupt handler
            break;
            }
            }

            //******************************************************************************
            // MAIN HET PROGRAM HANDLER
            // makes interrupt on falling edge on HET6 (pin6)
            //******************************************************************************
            L00: ECNT {next=L01, irq=ON, event=FALL, pin=CC6, data=0}
            L01: BR {next=L00, cond_addr=L00, event=NOCOND}



            --
            Best regards,
            Roman Antoshchenkov

            mailto:djantoxa@...
          • Антощенков Роман Викт
            Hello! HET microcode: ; // generate inq on falling edge on pin 6 L00: ECNT {next=L01, irq=ON, event=FALL, pin=CC6, data=0} ; // generate inq on falling edge on
            Message 5 of 5 , Mar 4, 2008
            • 0 Attachment
              Hello!

              HET microcode:
              ; // generate inq on falling edge on pin 6
              L00: ECNT {next=L01, irq=ON, event=FALL, pin=CC6, data=0}
              ; // generate inq on falling edge on pin 7
              L01: ECNT {next=L02, irq=ON, event=FALL, pin=CC7, data=0}
              ; // unconditional jump to line 0 (LOOP)
              L02: BR {next=L00, cond_addr=L00, event=NOCOND}

              Setting HETPRY register:
              each bit 64bit register enable interrupt in line of HET microcode
              HETPRY = 0x03; // Enable interrupts in line 0 and line1


              //******************************************************************************
              // HET1 interrupt handler
              //******************************************************************************
              void HET1_irq_handler(void) {
              switch ((0xff & HETOFF1)-1)
              {
              case 0x0: // line of HET code
              HET1_line0_handler();
              HETOFF1 &= ~0x1; // clear interrupt
              break;
              case 0x1: // line of HET code
              HET1_line1_handler();
              HETOFF1 &= ~0x2; // clear interrupt
              break;
              }
              }

              //******************************************************************************
              // MAIN INTERRUPT HANDLER
              //******************************************************************************
              #pragma vector=IRQV /* IRQ vector address */
              __irq __arm void irq_handler(void) {
              switch ((0xff & IRQIVEC)-1)
              {
              case CIM_HET1:
              HET1_irq_handler();
              break;
              case CIM_GIOA:
              GIO1_irq_handler();
              break;
              }
              }


              --
              Best regards,
              Roman Antoshchenkov

              mailto:djantoxa@...
            Your message has been successfully submitted and would be delivered to recipients shortly.