Teensy 4.1 as SPI Slave with both MISO and MOSI functioning

Status
Not open for further replies.
I'm working on a project where I'm emulating a TSC2046 Touchscreen driver (https://www.ti.com/product/TSC2046) which is an SPI Slave using the Teensy 4.1 board. The master polls the slave ~60 times per second, with gaps in between each polling frame.

The SPI CLK oscillates at ~2 Mhz.

The first 8-bit command checks if the touchscreen is pressed, followed by a 16 bit response from the slave (though the last 4 bits aren't used, so it's only sending 12 bits of data over). Depending on the response, the master may or may not continue polling for more info in the polling frame. If it continues, it will poll 4 times, the first two for the X coordinates, and the second two for the Y coordinates. The commands are 8 bits, and it expects 16 bits. There is a time when both MISO and MOSI are active.

For each polling frame, I would have set responses given the command.

Between polling frames, there is around 16 ms, which should be more than enough for me to update what the responses are depending on the SPI command.

Below is a zoomed out logic analyzer image as well as one of a single polling frame, and one zoomed in a bit more of the first part of a polling frame.

What's the best way to go about doing this project?

logic1.jpg

logic2.jpg

logic3.jpg
 
Status
Not open for further replies.
Back
Top