The SPI clock is actually 10 MHz, not 12 as previously stated. That seemed reasonable, and I was considering increasing it since the FT813 can support up to 30 MHz. However, due to the mechanicals of the system, the ribbon cable connecting the main board to the display looks like it's 16 to 18 inches. I don't know what this translates to as far as a max SPI clock speed, but maybe 10 MHz is pushing the envelope.
I was going to run a test with a lower clock speed, but identified a separate problem/bug in the application firmware. The code that initiates the SPI transaction to get touch tag was not checking the return code from the SPI library call that executes the transaction; it just set the flag indicating that a tag had been read and thus no longer available to read. The application was locking up on a particular screen, and when it stopped responding to touch, the interrupt was firing, the flags indicated a new touch tag was available, but there was no SPI transaction to read the tag, even though that code is executed unconditionally. This indicated a failure in the SPI library call (this is on an NXP RT1064, by the way). I moved the line of code that cleared the touch tag available flag to the point where the call had to have succeeded, which will force a retry on failure. I could not reproduce the lockup scenario after making this change.
What's peculiar about this is that I was also no longer able to reproduce the 300 ms gap when refreshing the main screen, but that has nothing to do with touch tags. I'm wondering if moving around the cable to check length affected performance somehow. These issues do appear to be related to the SPI port at the micro.
With regard to the interrupt handler, it does not include any SPI transactions. The concern was that an interrupt could occur in the middle of sending commands to the coprocessor in preparation for updating the display. The interrupt handler just sets a flag indicating that an interrupt has occurred, and the application idle loop picks up on that and reads the interrupt flags when the command coprocessor is idle.
I am going to continue to test, and will post logic analyzer logs along with images if I see issues.
I was going to run a test with a lower clock speed, but identified a separate problem/bug in the application firmware. The code that initiates the SPI transaction to get touch tag was not checking the return code from the SPI library call that executes the transaction; it just set the flag indicating that a tag had been read and thus no longer available to read. The application was locking up on a particular screen, and when it stopped responding to touch, the interrupt was firing, the flags indicated a new touch tag was available, but there was no SPI transaction to read the tag, even though that code is executed unconditionally. This indicated a failure in the SPI library call (this is on an NXP RT1064, by the way). I moved the line of code that cleared the touch tag available flag to the point where the call had to have succeeded, which will force a retry on failure. I could not reproduce the lockup scenario after making this change.
What's peculiar about this is that I was also no longer able to reproduce the 300 ms gap when refreshing the main screen, but that has nothing to do with touch tags. I'm wondering if moving around the cable to check length affected performance somehow. These issues do appear to be related to the SPI port at the micro.
With regard to the interrupt handler, it does not include any SPI transactions. The concern was that an interrupt could occur in the middle of sending commands to the coprocessor in preparation for updating the display. The interrupt handler just sets a flag indicating that an interrupt has occurred, and the application idle loop picks up on that and reads the interrupt flags when the command coprocessor is idle.
I am going to continue to test, and will post logic analyzer logs along with images if I see issues.