TM1638 interfacing

Wondering which pins are used on micro especially pin for DIO signal as this would need to be bidirectional? Any advice/help appreciated

You can use any GPIO pin. Most libraries will bit-bash the signals.
There is little need for speed.

The AVR has no hardware for bi-directional SPI. Many ARM chips do support bidirectional DIO pin for SPI.


SPI has only unidirectional pins IIRC, so what good would that serve?

There are lots of "SPI" devices that use a single bidirectional pin.

e.g. the popular ST7735 TFT displays.

I would agree with you that "standard 3-wire SPI" uses CS, SDI, SDO, SCK signals.
But many MCU peripherals provide "extra" features. e.g. modes #0, #1, #2, #3.
or Master-Slave haywire-ability.
or bit-order
or bit-width
or ...

Oh, there are many "serial devices" that use a bidirectional data SDA pin.


That's not part of SPI (at least in my understanding).

The SPI interface can be used to connect to peripherals that are not really SPI, no doubt.

Yes, you have hit the nail on the head.

You can also criticise the TFT, GLCD, OLED, ADC, ... controller documentation. Or the ARM documentation.

In contrast, I2C is a clearly specified protocol. It just happens that "device operation" varies greatly.


I'm not criticising

but you, stating

e.g. STM32F401 datasheet

20.1 SPI introduction
The SPI interface provides two main functions, supporting either the SPI protocol or the I2S
audio protocol. By default, it is the SPI function that is selected. It is possible to switch the
interface from SPI to I2S by software.
The serial peripheral interface (SPI) allows half/ full-duplex, synchronous, serial
communication with external devices. The interface can be configured as the master and in
this case it provides the communication clock (SCK) to the external slave device. The
interface is also capable of operating in multimaster configuration.
It may be used for a variety of purposes, including simplex synchronous transfers on two
lines with a possible bidirectional data line or reliable communication using CRC checking.
The I2S is also a synchronous serial communication interface. It can address four different
audio standards including the I2S Philips standard, the MSB- and LSB-justified standards,
and the PCM standard. It can operate as a slave or a master device in full-duplex mode
(using 4 pins) or in half-duplex mode (using 3 pins). Master clock can be provided by the
interface to an external slave component when the I2S is configured as the communication

I suppose that we could be very pedantic and ban the word "SPI" in "SPI interface"

But I am happy with your


Thanks David for clarifying.
I guess the PINs output driver goes Hi Z when toggled to "input". Must be a degree of tolerance here electrically given there is no way to for the micro and the TM chip to prevent both devices being in output mode (albeit for a small time) during the toggling between setting their respective drivers between output and input.