Hi All,
I have a Maxim MAX11040K 4 channel, 24-bit ADC chip controlled from the SPI1 port of a C6748. I created a APP from the StarterWare's spi.c example which reads data from the fingerprint sensor of the development kit (which is not assembled!). Finally the APP works but I found this approach funny.
It enables the receive + transmit interrupts which immediately triggers the TX_EMPTY event, because the TX buffer is empty. This calls the SP1Isr() interrupt service routine which returns only if all the data bytes was sent and received. In other words it holds up the SoC, the interrupt service routine runs – in my case – for 25usec.
I modified the original interrupt service function to send and/or receive one byte only then immediately return from the interrupt. Once the byte is sent the next TX Empty interrupt should call the SPI1Isr() function again and the it should send and receive the next byte. But somehow the SP1Isr() function is called only once so the SPI sends the command byte but never receives the data from the ADC! I can’t understand this? Why the first TX EMPTY interrupt is fired and why the second and further TX EMPY interrupts do not?
Note: The SPI interrupts are disabled only if the desired count of bytes sent and received. In my case I have to send 13 bytes. The first byte is the read conversion result command, the next 12 bytes are dummy writes to keep the SPI clock going while I receive the 12-byte answer. 12 bytes = 4 * 3 bytes = 4 channels * 24 bits.
Many thanks if somebody has some idea what I am doing wrong.
Best regards,
Louis