I'm trying to get my SPI bus devices up and running on a custom circuit board that I've soldered together. Unfortunately, I neglected to add probe testing spots on this particular circuit board, and don't think I can directly test the SPI bus signals at the ICs. One is a 20 pin LED Current Sinking Driver in a SSOP package and the other is a microSD card holder.
I can't seem to get either device to work.
My MCU is a Teensy 3.1. (Arduino-compatible) In terms of firmware, I'm using Arduino v1.06 (highest version supported by Teensyduino), and Teensyduino V1.20. I'm using the SPI library/object for comms with the LED driver, and the SdFat library for comms with the sd card.
Here is the schematic of how my LED driver and SD card are hooked up:
According to the TLC59025 Datasheet, the timing diagram for communicating with the LED driver is as so:
My method of testing thus far, other than software (i.e. trying to open a file on the sd card), has been as follows:
- Made sure that the 3.3 V LDO serving the SD card was outputting correct voltage
- Attempted to begin serial comms with SD card using SdFat library (this was a no-go)
- Measured voltage at various LED Driver out pins, before and after sending two 8-bit words to the LED Driver's MOSI pin and pulsing LE high
If the particular LED output pin is latched and sinking current, then the voltage I measure at that pin should be near 0 V, correct?
My Master SPI clock speed is around 2 MHz. I know that the TLC59025 says it's operating point is 30 MHz. I thought that as long as the Master is using a SCK that is lower than the slave's clock, the comms would work. Am I wrong?
I thought that perhaps tri-state behaviour was to blame for my woes, however it looks like the TLC59025 LED Driver is designed to always be accepting data into it's shift register, even when it is not the intended slave being communicated with. It looks to me as though it is designed to simply latch the last 16 bits of data sent over the SPI MOSI bus whenever the LE pin is pulsed high.
I'm stumped as to how to proceed with troubleshooting. I know that the problem shouldn't be due to the MISO bus, since I only have one device (the SD card) hooked up on that bus. Could it be the MOSI bus? Is it possible that there is too much capacitance on the MOSI bus when I'm trying to communicate, thus degrading the data signal? If I add a tri-state buffer to the MOSI/CS signals on the SD card, and a pullup resistor on the chip select signal of the sd card, would that help maintain signal integrity on the MOSI bus (ie cut down capacitance of MOSI bus to the point that at least the LED driver should work?).