Wiring:
12V to TLC5947 VIN
D5 to LATCH
D11 to CLOCK
D10 to DATA
D15 to OE (UART RX - UART is disabled)
and ofc GND to GND
When I first power everything on, the shift registers initialize with random data and it looks extremely cool. However, no matter my efforts I get SPI timeouts when trying to use Adafruit_TLC4957 with Adafruit Blinka in the auto_write disabled, write-all-at-once pattern.
Kernel output via dmesg:
Code: Select all
[ 2613.533738] spidev spi0.0: SPI transfer timed out
[ 2613.533780] spi_master spi0: failed to transfer one message from queue
Code: Select all
2023-01-24 14:48:35 self.display.write()
2023-01-24 14:48:35 File "/usr/local/lib/python3.7/dist-packages/adafruit_tlc5947.py", line 161, in write
2023-01-24 14:48:35 self._spi.write(self._shift_reg, start=0, end=_STOREBYTES * self._n + 1)
2023-01-24 14:48:35 File "/usr/local/lib/python3.7/dist-packages/busio.py", line 386, in write
2023-01-24 14:48:35 return self._spi.write(buf, start, end)
2023-01-24 14:48:35 File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 86, in write
2023-01-24 14:48:35 self._spi.writebytes(buf[start:end])
2023-01-24 14:48:35 File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/spi.py", line 376, in writebytes
2023-01-24 14:48:35 "ioctl timeout. Please try a different SPI frequency or less data."
Code: Select all
self.bus = busio.SPI(clock=self.pinClock, MOSI=self.pinMOSI)
self.bus.try_lock()
self.bus.configure(baudrate=4000000)
self.bus.unlock()
self.display = adafruit_tlc5947.TLC5947(self.bus, self.pinLatch, auto_write=False, num_drivers=self.numDisplays)
...
if self.useHardware==True:
for pin in range(indices):
self.display[pin] = data[pin]
if pin % 12 == 0:
self.display.write()
(Notice my attempt to configure bus speed per PureIO's TimeoutError output. The problem exists without the lock/configure/unlock lines too.)
One thing I'm wrestling with is the idea of SPI timeouts in a system with no MISO connected. With no SPI secondary device acknowledgments possible, how could it time out? I'm guessing it's some BCM-internal DMA timeout?
I don't get a sense that 3 * 24 * 2 bytes should get anywhere near the 4096 byte SPI buffer... right?
Code: Select all
$ cat /sys/module/spidev/parameters/bufsiz
4096
Grateful for any help. Thank you!