Hi,
I have an audio processing chain running on the board. Works fine with adi_int_InstallHandler(..).
To this I'm adding another interrupt to receive data on UART0_RX_I. UART is routed via DPI PinBuffer. I am still getting familiar with signal routing + interrupt handling on the board. How should I program such that both interrupts get triggered as needed?
............... void main() { int count=0; adi_initComponents(); initPLL(); initExternalMemory(); init1939viaSPI(); /* configure AD1939 codec on the 21489 EZ-KIT */ enable_SPORT01_MCM_mode(); /* Turn on SPORT0 TX and SPORT1 RX for Multichannel Operation */ InitDAI(); /* Initialize DAI because the SPORT and SPI signals need to be routed */ initDPI(); /* Initialize all the FX blocks used in signal chain */ init_fx_blocks(); /* Install and enable a handler for the SPORT1 Receiver interrupt.*/ adi_int_InstallHandler(ADI_CID_P3I,(ADI_INT_HANDLER_PTR)process_AD1939_samples,NULL,true); *pPICR0 = 0x9DA95; adi_int_InstallHandler(ADI_CID_P3I, (ADI_INT_HANDLER_PTR)UARTisr, 0, true); // Install UART receiver interrupt *pUART0LCR = 0; *pUART0IER = UARTRBFIE; // enables UART0 receive interrupt initUART(); /* Enable multichannel operation (SPORT mode and DMA in standby and ready) */ *pSPMCTL0 |= MCEA; *pSPMCTL1 |= MCEA; for (;;) { if(count==10) puts("Talkthrough is running successfully"); count++; asm("idle;"); } } void initDPI() { SRU(UART0_TX_O, DPI_PB09_I); SRU(DPI_PB10_O, UART0_RX_I); } void initUART() { /* Sets the Baud rate for UART0 */ *pUART0LCR = UARTDLAB; //enables access to Divisor register to set bauda rate *pUART0DLL = 0x8B; //0x28b = 651 for divisor value and gives a baud rate of 19200 for peripheral clock of 200MHz *pUART0DLH = 0x02; /* Configures UART0 LCR */ *pUART0LCR = UARTWLS8 | // word length 8 UARTPEN | // parity enable ODD parity UARTSTB; // One stop bit *pUART0RXCTL = UARTEN; //enables UART0 in receive mode *pUART0TXCTL = UARTEN; //enables UART0 in core driven mode } void UARTisr() { value[count] = *pUART0RBR; if (count >= N) { count = 0; } }
Where InitDAI() is:
void InitDAI() { clearDAIpins(); /* Connect the AD1939 ADCs: The AD1939 drives a BCLK output to DAI pin 7, * a frame sync to DAI pin 8 and TDM rx data to DAI pins 5 * * Connect the TDM ADC stream to SPORT1, using data input A * All four lines are always inputs to the SHARC so tie the pin * buffer inputs and pin buffer enable inputs all low. */ SRU(DAI_PB07_O, SPORT1_CLK_I); /* DAIP17 (RSCLK1) to SPORT1 CLK (CLK) */ SRU(DAI_PB07_O, SPORT0_CLK_I); /* DAIP7 (RSCLK1) to SPORT0 CLK (CLK)*/ SRU(DAI_PB08_O, SPORT1_FS_I); /* DAIP8 (RFS1) to SPORT1 FS (FS)*/ SRU(DAI_PB08_O, SPORT0_FS_I); /* DAIP8 (RFS1) to SPORT0 FS (FS)*/ SRU(DAI_PB05_O, SPORT1_DA_I); /* DAIP5 (DR1PRI) to SPORT1 DA (RX) */ /* Connect the AD1939 DACs in TDM mode to SPORT0: * The clock and frame sync inputs are provided by the ADCs * * All DAC connections are always outputs from the SHARC * so tie the pin buffer enable inputs all high. * Connect the TDM DAC stream to SPORT0 A via DAI pin 12 */ SRU(HIGH, PBEN12_I); SRU(SPORT0_DA_O, DAI_PB12_I); // DAIP 13 (DT1PRI)to SPORT0 DA (TX) /* Route SPI signals to AD1939 Control Port. */ SRU(SPI_MOSI_O, DPI_PB01_I); /*Connect MOSI to DPI PB1. */ SRU(DPI_PB02_O, SPI_MISO_I); /*Connect DPI PB2 to MISO. */ SRU(SPI_CLK_O, DPI_PB03_I); /*Connect SPI CLK to DPI PB3.*/ SRU(SPI_FLG0_O, DPI_PB04_I); /*Connect SPI FLAG0 to DPI PB4.*/ /* Tie pin buffer enable from SPI peipheral to determine whether they are * inputs or outputs */ SRU(SPI_MOSI_PBEN_O, DPI_PBEN01_I); SRU(SPI_MISO_PBEN_O, DPI_PBEN02_I); SRU(SPI_CLK_PBEN_O, DPI_PBEN03_I); SRU(SPI_FLG0_PBEN_O, DPI_PBEN04_I); }