Can I use BFIFO of McBSP without EDMA ?
Can you have an example or documentation ?
By Sergio D'Orazio.
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.
Can I use BFIFO of McBSP without EDMA ?
Can you have an example or documentation ?
By Sergio D'Orazio.
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
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?
If you're trying to reduce power, my recommendations are:
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.