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.

McBSP

Other Parts Discussed in Thread: OMAPL138

Can I use BFIFO of McBSP without EDMA ?

Can you have an example or documentation ?

By Sergio D'Orazio.

  • Let me check and confirm.
    I hope we have examples but not sure which package.
    Thanks for your patience.
  • Sorry for the delay in response.
    We have very less example on McBSP, BTW.

    C:\ti\pdk_OMAPL138_1_01_00_02\packages\ti\drv\exampleProjects\MCBSP_MasterExampleProject

    You can configure this example as interrupt, poll and DMA method.


    C:\ti\pdk_OMAPL138_1_01_00_02\packages\ti\drv\mcbsp\mcbsp_drv.h

    /**
    * \brief Mcbsp driver operational mode
    *
    * Enumeration of the different modes of operation available for the
    * Mcbsp device driver.(Mcbsp driver supports only EDMA mode).
    */
    typedef enum Mcbsp_OpMode_t
    {
    Mcbsp_OpMode_POLLED = 0,
    /**< Polled Mode */

    Mcbsp_OpMode_INTERRUPT,
    /**< Interrupt Mode */

    Mcbsp_OpMode_DMAINTERRUPT
    /**< DMA Mode */

    }Mcbsp_OpMode;
    /**< Mcbsp driver operational mode */


    C:\ti\pdk_OMAPL138_1_01_00_02\packages\ti\drv\mcbsp\example\omapl138-lcdk\MCBSPMaster\mcbspSampleMaster_main.c

    const Mcbsp_Params Mcbsp_PARAMS =
    {
    Mcbsp_DevMode_McBSP, /* Use the device as MCBSP */
    Mcbsp_OpMode_DMAINTERRUPT, /* Use DMA mode of operation */
    TRUE, /* cache coherency taken care of by driver */
    Mcbsp_EmuMode_FREE, /* Emulation mode free is to be enabled */
    #ifdef MCBSP_EXTERNAL_CLOCK
    Mcbsp_Loopback_DISABLE, /* Loop back mode disabled */
    #else
    Mcbsp_Loopback_DISABLE, /* Loop back mode enabled */
    #endif
    &mcbspSrgCfg, /* sample rate generator configuration */
    NULL, /* TX pending buffer queue from application */
    NULL, /* TX floating buffer queue in DMA */
    NULL, /* RX pending buffer queue from application */
    NULL /* RX floating buffer queue in DMA */
    };

  • Hi,

    The mcbsp_drv.h header file seems to have the option but the mcbsp_drv.c file contains:

                /* Only DMA mode of the operation is supported for Mcbsp mode     */
                if ((Mcbsp_DevMode_McBSP == params->mode) &&
                    (Mcbsp_OpMode_DMAINTERRUPT != params->opMode))
                {
                    status = MCBSP_ERR_BADMODE;
                }
    

    So it looks like the code only supports the DMA mode of operation.

    It is unclear from the documentation as to whether it is possible to use the McBSP BFIFO (with interrupts) without DMA. For example Figure 26-1 in SPRUH77A only shows interrupts going from the McBSP module to the CPU, not from the BFIFO. So just looking at that figure it looks like the CPU would get interrupted for every byte/word which is not ideal (the FIFO is still slightly useful in this case as a late servicing of the interrupt will not cause a overrun/starvation but it has a high CPU impact).

    Thanks

    Nigel

  • But in SPRUGJ6C.pdf , par. 2.7.6.1 BFIFO Data Transmission , speak about the CPU write the BFIFO and BFIFO send DMA request to the host.
    Can CPU manage DMA request from BFIFO ?
    Thanks
    Sergio.

    T
  • You might be able to poll the event bits in the DMA controller but I can't see any way to generate host interrupts directly off these events (but I could be missing something).
    Thanks
    Nigel
  • Nigel Paton said:
    It is unclear from the documentation as to whether it is possible to use the McBSP BFIFO (with interrupts) without DMA. For example Figure 26-1 in SPRUH77A only shows interrupts going from the McBSP module to the CPU, not from the BFIFO.

    You're correct that the McBSP interrupts go directly to the CPU, so this restricts your ability to use the BFIFO significantly.  Basically, it forces you to set the threshold values for the FIFO to 1 and then you are servicing the interrupt every time.  There is still some minor benefit to the BFIFO in that scenario.  In particular, even if you miss your real-time deadline in servicing the McBSP, you're not going to overflow/underflow.  So it helps from that perspective, but you're losing a key benefit in terms of being able to reduce interrupts.  However, if you're trying to reduce CPU interrupts, we have EDMA for that purpose.  Why aren't you using EDMA?

  • I want use BFIFO with and without EDMA and test the different power consumption.

    Sergio.
  • If you're trying to reduce power, my recommendations are:

    1. Verify that all unused peripherals are in a "disabled" state in the PSC.  You can check that easily with this gel file.
    2. Try to run at a lower operating point if possible, i.e. reducing the voltage makes a big impact.

    I would expect that using the DSP to service the McBSP will require a lot more power than the EDMA.  I would go the opposite route, i.e. try to do more with EDMA to enable you to achieve a lower operating point.