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.

MibSPI1 Trigger example setup using HalCoGen

Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

Would someone guide me how can I setup MibSPI1 Trigger using HalCogen ?

Target : TMS570LS3137

emulator board : XDS100V2 JTAG.

 

  • Keyur,

    Which kind of trigger do you plan to use? Internal or external?

    I will search and see if we have an example ready to be shared.

  • internal trigger from NHET1 pin 14.

    NHET1 pin 14 would trigger MibSPI1 and MibSPI1 should flashes LED whenever it receive signal. 

  • Keyur,

    I've created a basic project using Halcogen to demonstrate the functionality of MIBSPI with an hardware trigger.

    As per your request, NHET1_14 is used as trigger for MIBSPI1. The trigger will be active on a rising edge of NHET1_14.
    MIBSPI1 uses transfer group 0, with 8 16bits buffers. On transmission, using Format 0, CS_0 will be active.

    The NHET1 is generating 2 PWM at 1Hz, on pin_0 visible via an LED on the board and pin_14 (MIBSPI Trigger)

    The main application is defined as:

    void main(void)
    {
    /* USER CODE BEGIN (3) */
        uint16 trans_data[8]=  {0x1111,
                                0x2222,
                                0x3333,
                                0x4444,
                                0x5555,
                                0x6666,
                                0x7777,
                                0x8888
                               };
        hetInit();
        mibspiInit();
        while(1)
        {
         mibspiSetData(mibspiREG1,0,trans_data);
         mibspiTransfer(mibspiREG1,0);
         while(mibspiIsTransferComplete(mibspiREG1,0)==FALSE);
        }

    /* USER CODE END */
    }

    An array of 16bit words is defined.
    hetInit() is called. This will initialize the NHET and copy the NHET code in NHET_RAM. NHET is now running.
    mibspiInit() is called. This will initialize the MIBSPI1 according to my previous comments.
    mibspiSetData() will copy the data from RAM to MIBSPI_RAM.
    mibspiTransfer() will start the mibspi transfer. Because trigger is used, the transfer will only start on a rising edge of HET1_14.
    mibspiIsTransferComplete() will check for the completion of the transfer before restarting the sequence.


    The CCS project as well as Halcogen project are attached here: 0815.MIBSPI_trigger.zip

    Please have a try and let me know if this is useful.

  • Thanks Jean for your support.

  • Is it possible to use the NHET as an external trigger for MibSPI?  So basically like a GIO pin.