Driver question for Shield Shield


I’m trying to build a simple setup to automate some of the kids toys. I’m trying to use the Shield Shield and am running into an odd problem. In the process of chasing this issue, I think that I ran into another. They both seem to be related to the use of the TXB108 device as a level translator.

I wired up a bright LED (Vf=2V, i=20ma) to the equivalent of the A7 pin. (6 for Arduino). I set up a basic script to blink in at a 2 Hz rate. I used a 150 ohm resistor to drop the extra 3 volts. The odd bit is that some of the light pulses are brighter than others. I finally grabbed a scope from the office and looked at the hot side of the LED. Some of the pulses are exactly what I would expect, approximately 2V and steady through the pulse, but most of them have a 50-60 MHz oscillation from 3V to 5V, throughout the pulse. If I probe the A7 pin on the Spark, it is stable and quiet (as expected). This is essentially the only wire on the board at this point. I suspect that I’m asking for too much current out of the device. This behavior seems slightly temperature dependent, in that it will appear and disappear over a longer period of time. I cut the drive current down to 10 ma, with no change.

Oddly, I threw a bypass cap from ground to the driver side of the LED resistor, this caused the A7 input to show the oscillations. I think that this is due to the load starting to look like a driver and turning the direction of the buffer around when the pulse ends from the Spark.

When I pulled down the TXB108 data sheet from the GitHub pool, I was looking for the amount of current that the device could source. I’ve still not found that, but I did find something that was interesting. There is a note on page 11 of that spec sheet titled: “Pullup of Pulldown Resistors on I/O Lines”. This essentially says that if there are pullups or pulldowns on the I/O buffers they must be 50K or better. This makes driving an LED a bit of an issue.

Furthermore, the next paragraph implies that the chip should not be used with open-drain devices hooked to it, it specifically points at I2C and 1Wire as applications that will not work. Unortunately, the very next step on this board was to turn on an I2C PWM device and an LCD display.

The real question is: Was this known or understood that the Shield Shield was liable to not be able to drive much of a load or handle I2C? I don’t see any reference to this in the board documentation. A bit of a bummer for my plans, but just trying to make sure that I understand if I’m looking at this right.



Hi @johnbo
I’ve just started playing around with the Shield Shield, and too had problems using a OneWire / DS18B20 sensor with it. Finally found your post. What I was able to do, since I wanted to use the shield-shield with an Arduino 4x relay board, was to physically cut the land on the Shield-shield board for D2 that I’m using for the temp sensor. D1, D3, D4, and A7 control the relays. A small cut with a razor is all it takes to remove a digital I/O from the S-S. Now I can control the relays, and get readings from the DS18B20 connected to the D2 header-pad on the S-S without the S-S interfering. Worst case is a little solder to reconnect the land to the header-pad if you ever need it again though the S-S Arduino header.
Hope this may help your project.

Why would you need to cut out the trace? I remember that for OneWire, you can simply change the pins to any digital pins…

@kennethlimcp, there may be some issues.
I have a Spectrum Shield connected to a Spark Core through a Shield Shield. I have a ws2812b power strip with a 4700uF/10V cap across a 5V/10A power supply. +5V from one end of the LED strip and GND from the other end are connected to the power supply, and VCC/GND from the data in side are connected to VIN/GND on the Spectrum Shield/Shield Shield. The Spectrum Shield is set on risers which are set on the Shield Shield. The data wire is connected to a 330Ohm resistor to analog pin 11 on the Shield Shield (corresponding to pin A5 on the Spark Core).

I am not able to light up the LEDs with this configuration. If I get rid of the Shield Shield and connect data to pin A5 on the Spark Core and +5V/GND to VIN/GND on the Spark Core, everything runs smoothly.

Here is a picture of the configuration with the Shield Shield:

The Spark Core, Shield Shield and Spectrum Shield all have LEDs which light up when I plug in the power supply. I checked and power is going through the LED strip and powering the Shields and Spark Core. Could the issue be the 330Ohm resistor across the data line?

  1. I will try to run the WS2812B with just a core and make sure it lights up

  2. Next would be to plug the core to the shield shield and test the WS2812B again

  3. Once it’s all good, the spectrum shield should work well. I’m suspecting that the Spectrum shield might also be using SPI?

The spectrum shield uses the ADCs on pins A0 and A1 (Arduino pins A0 and A1) and analogRead() to grab the left/right channel voltages, respectively.

I will make sure it is working with the old configuration. Then I will add the Shield Shield, and if it still is working I will add the Spectrum Shield and try to narrow down what change precisely is causing the issue. I’ll report back later on today.

1 Like

Yes, the strip works plugged into the Spark Core, but when I introduce the Shield Shield the LED strip no longer works. The Spark Core is powered and responding correctly to HTTP POST requests when connected to the Shield Shield, but the LED strip is apparently “turned off” by the ‘shape’ of the data signal output from pin 11 on the Shield Shield.

I noticed also, when I disconnect power from the configuration w/ the Shield Shield, the LED strip flashes brightly once.

Old Config: VCC–>VIN; GND–>GND; A5–>DIN ( works )
w/ShieldShield: VCC–>VIN; GND–>GND; pin11–>DIN ( Core works, not leds though )

I think i know why.

Can you simply solder to the A5 pin pad for the core? There are rows of additional pads beside the core placement area :wink:

1 Like

EDIT: This is a working solution!

I was thinking about this as I was going to sleep. Just so I am sure I understand you correctly, I should solder the data wire from the LED strip to the through-hole slot next to pin A5, circled like so?

Thank you for the suggestion!

1 Like

Yeah especially when the WS2812B is kind-of particular about the data signal :wink:

The level shifter (i think) doesn’t allow switching at that speed!

1 Like

I tried looking at the txb0108 datasheet but wasn’t able to tell if the timings were preventing communication or not.

So everything is working. I have a bluetooth speaker (with it’s own battery) daisy chained to the Spectrum Shield, so I can pipe music from any bluetooth device and control visualizations on the ws2812b strip with a local webpage.

Question, with the Shield Shield are my ADCs limited to 10bits as on an Arduino Uno? Or am I still converting voltage to a 12bit number (0 to 4096?) like the Core?

the ADC should behave as though you are connected to the core.

As for SPI, the core is running at default DIV4 of 24MHz which gives us 6MHz. The txb0108 seems faster than that.

@BDub, you are much better than me in this. Could you share more with us? :wink:

@kennethlimcp, that is slightly incorrect. The SPI clock is DIV4 of 72MHz (not 24MHz) which is 18MHz. The rated speed of the txb0108 is 20MHz so it should work. It would be interesting so see if it works at a lower SPI clock. I suspect rise & fall time (slew rate) may be an issue at the higher clock speed. :smile:


Oh nice! @peekay123 can you show me where to find the clock settings? Which repo?

I went to check earlier and determined to be that speed but i probably was looking at the wrong line :wink:


1 Like

The ws2812b chips do dynamic signal reshaping, here is a blog posting looking at this process and cautioning against trying to pack too many messages in too short of a time.

I’m not 100% sure it’s relevant here ;p

1 Like

Its actually Div4 of the peripheral bus clock speed which is half the system click speed or 36 MHz. So Div4 is 9 MHz. The maximum SPI clock on a STM32F103CB is 18 MHz.

I see the drivers I’m using call :

SPI.setClockDivider(SPI_CLOCK_DIV8); // System clock is 72MHz, we need 9MHz for SPI

So maybe if I had just set this to SPI.setClockDivider(SPI_CLOCK_DIV4); it would have worked to get 9MHZ when connected to the Shield Shield.

Yes that should give you a SPI Clock of 9 MHz

@pra, good catch! I was looking at the wrong side of the clock tree. @kennethlimcp, we really need to document that somewhere. :smile:

1 Like

@kennethlimcp it seemed the chips on the shield shield were still interfering, even when I tried in the spark core header pins. The only way was to isolate the spark from the shield shield. I also tried using one of the analog/digital pins on the shield shield (A5) and it still wouldn’t read any values. Am I missing something?
Thank you