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.

RTOS/AM5728: McASP transmit problem

Part Number: AM5728

Tool/software: TI-RTOS

HI! When  I configure the MCASP (DATA port  \  4slot TDM),I have a problem.    

After write the first data to XBUF ,TXSTAT[5]XDATA is always 0. why?  

I'm very grateful to you for your help.

my code :

void McaspTxInternalInit(uint32_t baseAddr)
{
//Global Initialization
McaspGlobalReset(baseAddr);
//2. Configure the FIFO.
McASPWriteFifoDisable(baseAddr); //NO FIFO

McASPReadFifoDisable(baseAddr); //NO FIFO
//3. Configure the local power management.
McASPSetPowerIdleConfig(baseAddr, MCASP_IDLEMODE_NOIDLE); //0x1: No-idle mode
//4. Configure the transmit format unit.
McASPTxFmtMaskSet(baseAddr, TXMASK32); //NO MASK

McASPTxFmtSet(baseAddr, MCASP_TX_SYNC_DELAY_2BIT | MCASP_TX_BITSTREAM_LSB_FIRST |
MCASP_TX_PAD_WITH_0 | MCASP_TX_SLOTSIZE_32BITS |
MCASP_TX_BUF_DMAPORT | MCASP_TX_ROT_RIGHT_NONE); //1 bit delay, LSB first, no PAD, 32bit slot, (PERICONFIGPORT)

//5. Configure the transmit frame sync generator.
McASPTxFrameSyncCfg(baseAddr, 0x4, MCASP_TX_FS_WIDTH_WORD, MCASP_TX_FS_INT_BEGIN_ON_RIS_EDGE); //4slot, single bit

//6.1 Configure the transmit clock generator.
McASPTxClkCfg(baseAddr, MCASP_TX_CLK_INTERNAL, TXMIXCLKDIV_1, TXAUXCLKDIV_2);

McASPTxClkPolaritySet(baseAddr, MCASP_TX_CLK_POL_RIS_EDGE); McASPTxHFClkPolaritySet(baseAddr, MCASP_TX_HI_FREQ_CLK_NO_INVERT); //6.2 Configure the transmit clock failure detect logic //TODO

//7. Program all bits - XTDMSk.
McASPTxTimeSlotSet(baseAddr, 0x0000000F); // TDMslot 0123 active

//8. Configure the desired n-th serializer for transmit mode operation.

McASPSerializerTxSet(baseAddr, TXAXR3);

//9. Setup all active transmitters to operate in TDM mode.
McASPDITModeCtlWrite(baseAddr, MCASP_TXDITCTL_DITEN_DISABLE);

 //10. Configure the MCASP pins functionality.
McASPPinMcASPSet(baseAddr, MCASP_PIN_AFSX| MCASP_PIN_ACLKX| MCASP_PIN_AXR(3));

//Configure the MCASP pins direction
McASPPinDirOutputSet(baseAddr, MCASP_PIN_AFSX); McASPPinDirOutputSet(baseAddr, MCASP_PIN_ACLKX); McASPPinDirOutputSet(baseAddr, MCASP_PIN_AXR(3));

//11. Optional : Configure a MCASP Tx channel for loopback operation (TDM mode only) in MCASP_LBCTL [31:0].
// no  LOOPBACK
//12. Release from reset state the divider that outputs the AHCLKR clock.
//13. Poll the bit to ensure that it is successfully latched in the register.
//14. Release from reset state the divider that outputs the ACLKR clock.
//15. Poll the bit to ensure that it is successfully latched in the register.
McASPTxClkStart(baseAddr, MCASP_TX_CLK_INTERNAL);
//Global Initialization END

//Operational Modes Configuration
McaspTxPollingMethod(baseAddr);

//Operational Modes Configuration END
}

  • The RTOS team have been notified. They will respond here.
  • Is there a reason why you have choosen to use MCASP functional CSL APIs and not the MCASP LLD driver for your code development? This is not a recommended model of coding that we can support as it appears that your creating your own driver. Please consider using the

    Typically after you have configured the MCASP if you are not able to transmit code, these are the typcial recommendations:
    * check to see if the serializer pin is enabled using device pinmux configuration in PADCONFIG register in control module.
    * Ensure the MCASP module clock is enabled from the SYSPLL
    * Put a scope on the McASP XCLK and frame sync and ensure that the state machine has started and is generating the right clocks.

    Also try and provide the information in the checklist below:
    processors.wiki.ti.com/.../Checklist_for_Processor_SDK_RTOS_questions_on_E2E

    Regards,
    Rahul
  • Thank you very much for your reply!More details of my problem are as follows:
    1.This is my first use of DSP.It's easy to use MCASP functional CSL APIs.
    2. pinmux configuration ,McASP XCLK (50MHz)and frame sync are correctly configured.
    3.CFG port 0slot ,I can receive frame sync and data .But CFG port 4slot ,I can only receive frame sync without data
    4.I want to use EDMA to transmit data, so DATA port is necessary.But CFG port 4slot and CFG port 4slot ,I can only receive frame sync without data
  • Correct the error
    4.I want to use EDMA to transmit data, so DATA port is necessary.But DATA port 0slot and DATA port 4slot ,I can only receive frame sync without data
  • Part Number: AM5728

    Tool/software: TI-RTOS

    HI!

    When  I configure the MCASP (DATA port  \  4slot TDM),PollingMethod.    I have a problem.   After initializing  MCASP, A buffer overrun occurs ,no data

    1.  I configure the MCASP (CFG port  \  4slot TDM).   Polling Method

    Low frequency(25kHz),I can receive 4 slot data,but high frequency(10MHz),After I first write data to MCASP_XBUF  ,A buffer overrun occurs ,no data.   why?

    2.  I configure the MCASP (DATA port  \  4slot TDM).   Polling Method

    Low or high frequency, After I first write data to MCASP_DAT ,A buffer overrun occurs ,no data.   why?

  • The RTOS team have been notified. They will respond here.
  • Hello!My board is AM5728EVM.When I configure the MCASP, I find a new confused problem.
    1. Before I configure McASPTxEnable(Release the Transmit State machine from reset AND Release the frame sync generator from reset) ,I must write once data to xbuf ,otherwise no data out.Why?
    2.The last questions still existed.
    I'm very grateful to you for your answer!