Hot!I2S issues with PLIB_SPI_ReceiverFIFOIsEmpty

Author
bordlab
Starting Member
  • Total Posts : 37
  • Reward points : 0
  • Joined: 2018/01/29 06:45:53
  • Location: 0
  • Status: offline
2018/10/31 10:56:05 (permalink)
0

I2S issues with PLIB_SPI_ReceiverFIFOIsEmpty

I am trying to bring up a custom board with a PIC32MZ2064DAG176 (Harmony 2.05.01 ). I am trying to communicate with the MAX98372 Amplifier over I2S to play alert tones.  I have configured the i2s driver as the part dictates.  I can load up the i2c queue with the following code.
 
 
    DRV_HANDLE handle = DRV_I2S_Open(DRV_I2S_INDEX_0, DRV_IO_INTENT_WRITE);    
    if (DRV_HANDLE_INVALID == handle)
    {
        return(-1);
    }
 
         i2sStatus = DRV_I2S_Status(sysObj.drvI2S0);
            if (SYS_STATUS_UNINITIALIZED < i2sStatus)
            {
                    DRV_I2S_BUFFER_HANDLE bufferHandle;
                    DRV_I2S_BufferAddWrite(handle, &bufferHandle, (void*)alert1, ALERT_1_SIZE);
                    i2sStatus = SYS_STATUS_UNINITIALIZED;
            }

 
I have traced the code down to the point the data is in the queue but the queue will not process they data because this condition is not met.
drv_i2s.c line 562
if (false == PLIB_SPI_ReceiverFIFOIsEmpty(drvObj->spiID))

 
Seems like I am missing something.  Any help would be much appropriated.
#1

1 Reply Related Threads

    bordlab
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2018/01/29 06:45:53
    • Location: 0
    • Status: offline
    Re: I2S issues with PLIB_SPI_ReceiverFIFOIsEmpty 2018/11/01 11:42:10 (permalink)
    0
    Just to try something.  I set the condition to always true.  I am able to write the data using PLIB_SPI_BufferWrite and move to the next byte.
     
    The write function in spi_Buffer_default.h

    PLIB_TEMPLATE void SPI_BufferWrite_Default( SPI_MODULE_ID index , uint8_t data )
    {
        spi_registers_t volatile * spi = ((spi_registers_t *)(index));
        spi->SPIxBUF = data;
    }

     
    Loads the data but I can not find where it gets clocked out of the pins.  So the data is written to the buffer until it gets full then it sits in that state waiting for something to take that data and transmit it. 
     
    Not sure where the rabbit whole will lead.  Any help would be greatly appreciated! 
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5