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.

No signal in Data pin (I2S_Dataline_0) when using I2S_CPU_MODE



I am using McASP module in I2S_CPU_Mode. I am getting the Word clock and bit clock but I am getting any data in the TX pin (I2S_Dataline_0).

The following is the code I am using,

#include <stdio.h>

#include "hw_types.h"

#include "hw_ints.h"

#include "hw_memmap.h"

#include "hw_common_reg.h"

#include "interrupt.h"

#include "pin.h"

#include "hw_apps_rcm.h"

#include "prcm.h"

#include "rom.h"

#include "rom_map.h"

#include "prcm.h"

#include "gpio.h"

#include "i2s.h"

#include "utils.h"

#include "pinmux.h"


extern void (* const g_pfnVectors[])(void);


static void BoardInit(void)

{

MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);


MAP_IntMasterEnable();

MAP_IntEnable(FAULT_SYSTICK);


PRCMCC3200MCUInit();

}

void
PinMuxConfig(void)
{
//
// Enable Peripheral Clocks
//
MAP_PRCMPeripheralClkEnable(PRCM_I2S, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_I2CA0, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA0, PRCM_RUN_MODE_CLK); //Added for external LED
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralClkEnable(PRCM_GPIOA2, PRCM_RUN_MODE_CLK);

//
// Configure PIN_50 for MCASP0 McAXR1
//
MAP_PinTypeI2S(PIN_50, PIN_MODE_6);

//
// Configure PIN_55 for UART0 UART0_TX
//
MAP_PinTypeUART(PIN_55, PIN_MODE_3);

//
// Configure PIN_57 for UART0 UART0_RX
//
MAP_PinTypeUART(PIN_57, PIN_MODE_3);

//
// Configure PIN_63 for MCASP0 McAFSX
//
MAP_PinTypeI2S(PIN_63, PIN_MODE_7);

//
// Configure PIN_64 for MCASP0 McAXR0
//
MAP_PinTypeI2S(PIN_64, PIN_MODE_7);

//
// Configure PIN_01 for I2C0 I2C_SCL
//
MAP_PinTypeI2C(PIN_01, PIN_MODE_1);

//
// Configure PIN_02 for I2C0 I2C_SDA
//
MAP_PinTypeI2C(PIN_02, PIN_MODE_1);

//
// Configure PIN_04 for GPIOInput
//
MAP_PinTypeGPIO(PIN_04, PIN_MODE_0, false);
MAP_GPIODirModeSet(GPIOA1_BASE, 0x20, GPIO_DIR_MODE_IN);

//
// Configure PIN_15 for GPIOInput
//
MAP_PinTypeGPIO(PIN_15, PIN_MODE_0, false);
MAP_GPIODirModeSet(GPIOA2_BASE, 0x40, GPIO_DIR_MODE_IN);

//
// Configure PIN_62 for GPIOOutput // External LED
//
MAP_PinTypeGPIO(PIN_62, PIN_MODE_0, false);
MAP_GPIODirModeSet(GPIOA0_BASE, 0x80, GPIO_DIR_MODE_OUT);


//
// Configure PIN_53 for MCASP0 McACLK
//
MAP_PinTypeI2S(PIN_53, PIN_MODE_2);
}


void I2SIntHandler()

{

unsigned long ulStatus;

unsigned long ulDummy;


// Get the interrupt status

ulStatus = MAP_I2SIntStatus(I2S_BASE);


// Check if there was a Transmit interrupt; if so write next data into the tx buffer and acknowledge

// the interrupt

if(ulStatus & I2S_STS_XDATA)

{

MAP_I2SDataPutNonBlocking(I2S_BASE,I2S_DATA_LINE_0,0xAA554321);

MAP_I2SIntClear(I2S_BASE,I2S_STS_XDATA);

}

// Check if there was a receive interrupt; if so read the data from the rx buffer and acknowledge

// the interrupt

if(ulStatus & I2S_STS_RDATA)

{

MAP_I2SDataGetNonBlocking( I2S_BASE, I2S_DATA_LINE_1,&ulDummy);

MAP_I2SIntClear(I2S_BASE,I2S_STS_RDATA);

}


// Toggle LED to show ISR is being called

{

unsigned char uc=MAP_GPIOPinRead(GPIOA1_BASE,GPIO_PIN_2) ? 0 : GPIO_PIN_2;

MAP_GPIOPinWrite(GPIOA1_BASE,GPIO_PIN_2,uc); // Yellow LED, GPIO_10

}

}


void main(void)

{

BoardInit();


PinMuxConfig();


MAP_PRCMPeripheralReset(PRCM_I2S);

MAP_PRCMI2SClockFreqSet(14112000);

MAP_I2SConfigSetExpClk(I2S_BASE, 14112000, 1411200, I2S_SLOT_SIZE_24|I2S_PORT_CPU);

MAP_I2SIntRegister(I2S_BASE, I2SIntHandler);

MAP_I2SIntEnable(I2S_BASE,I2S_INT_XDATA);

MAP_I2SSerializerConfig(I2S_BASE, I2S_DATA_LINE_0,I2S_SER_MODE_TX, I2S_INACT_LOW_LEVEL);


MAP_I2SSerializerConfig(I2S_BASE, I2S_DATA_LINE_1, I2S_SER_MODE_RX, I2S_INACT_LOW_LEVEL);

MAP_I2SEnable(I2S_BASE, I2S_MODE_TX_RX_SYNC);


while(1)

{

__asm(" nop\n");

}

}