2013-06-10 09:53 AM
Hello,
I am programming a resistive touch screen controller, the AR1021-I/SS.This device communicates with a SPI port. Data are transmitted on SDO at SCK falling edge, but we can also configure the chip on SDA.For the moment I just want to get back data of the touch screen controller, according to this figure:IRQ is an interruption which goes high when the user touch the screen.What is the proper way to generate the clock 5 times (like beat banging) on SCK? I try GPIO_SetBits/GPIO_ResetBits on SCK but it didn't works... Thanks !2013-06-10 10:04 AM
If the STM32 is the master, I'd imagine you could transmit 5x 8-bit bytes to generate the clocks, and at the same time receive back 5x 8-bit bytes.
2013-06-11 01:39 AM
In fact, it seems I can't do that because when I send 5x8bit to generate the clock, the touch screen controller thinks that I try to configure it (but it don't understand the 5x8bit so it crashes).
The is why in the figure of Microchip the SDI port is not active, only CLK is clocking. How can I do to achieve this ?2013-06-11 05:43 PM
How can I do to achieve this ?
Send zeros? Turn the pin into a GPIO driven low?
2013-06-12 03:30 AM
I can't because my SPI drives 3 peripherals... Or maybe I can change the GPIO pin config each time I need to generate a clock ?
2013-06-12 04:16 AM
I can't because my SPI drives 3 peripherals...
The plot thickens. So what's the difference between sending zeros and clamping the pin low in this specific instance? Have you looked at the signals with a scope/analyzer? Do these assorted devices on the SPI have their own chip selects?2013-06-12 05:02 AM
Yes, theses devices have there own chip select.
Now I think it's a problem of my USART config: the touch controler is not a full duplex device (data are sent and received on two lines but not in the same time).There is 5 possibles SPI direction configs:#define ((uint16_t)0x0000)
#define ((uint16_t)0x0400)
#define ((uint16_t)0x8000)
#define ((uint16_t)0xC000)
#define (MODE)
Which one fit to my application ?