STM32F103XX CORTEX-M3 series of chips containing three-way SPI channel, Red Bull Development Board used two roads, SPI1 connection at45db161b model SPI flash,spi2 connection ADS7843 touch screen signal processing chip, SPI3 is best not to use, Because there is a conflict with the JTAG pin, there will be problems in debugging. The em-stm3210e Development Board, which does not contain a touch screen, uses only the same way to connect SPI Flash. This article describes touch screen coordinates acquisition, so only users with Red Bull Development Board can test.
First of all, a brief introduction of SPI-related knowledge, SPI is the English serial Peripheral interface abbreviation, as the name implies is the serial peripheral device interface. was first defined by Motorola on its Mc68hcxx series processor. SPI interface is mainly used in Eeprom,flash, real-time clock, ad converter, and digital signal processor and digital decoder, is a high-speed, Full-duplex, synchronous communication bus.
SPI's communication principle is simple, it works in a master-slave mode, which usually has a master device and one or more from the device, requires at least 4 lines, in fact, 3 can also (for one-way transmission, that is, Half-duplex mode), the relevant pin meaning is as follows:
(1) sdo– The main equipment data output, from the equipment data input
(2) sdi– The main equipment data input, from the equipment data output
(3) sclk– clock signal, generated by the main equipment
(4) cs– from the equipment to enable the signal, controlled by the main equipment
(For more information, please see Baidu Encyclopedia SPI Entry: http://baike.baidu.com/view/245026.htm)
Again, ADS7843 chip knowledge, the Red Bull Development Board on this chip schematic diagram is as follows:
It is a pity that the interrupt pin (INT) is not drawn from the schematic diagram, so the x,y coordinates can only be obtained by polling.
ADS7843 chip SPI Communication sequence diagram is as follows: