Thank you Michael for the quick response!
It looks like i will get the 74AHCT125.
Also a quick question, if I build a small step-up level shifter (3.3v to 5v) using resistors and diodes, would that be good speed wise?
Something similar to this if you scroll down a little bit:
https://hackaday.com/2016/12/05/tak...and-5v-logic-communicate-with-level-shifters/
I would imagine that would be too slow. Paul S. has generally said 'naive' level shifters made of resistors and diodes normally is not fast enough. The issue with the ws2812b is it has a very precise timing window that you have to hit. This allows it to omit the 2nd data wire for clocking like the APA102/dotstar LEDs use. But it also causes all of the problems with interrupts.
Thanks defragster! Is that shield compatible with teensy 3.6?
As defragster says, the position of the back 5 pins (on the 3.2: DAC, program, ground, 3.3v, and Vbat) has moved in the 3.5/3.6. The only pin of those 5 pins that the prop shields really care about the DAC pin for producing mono sound. If you care about sound, you can easily snake a wire from A21 (DAC0) to the pin on the prop shield. Also remember if you are mounting the prop shield on top, you probably need to snake out the 'program' wire so you can connect it to ground if you need to physically get the board into program mode.
The other pins the prop shield uses all have the same position in the 3.5/3.6.
Note, if you have SPI display(s), SPI uses pins 11/13 and does advanced SPI operations, you have to be care to properly stop the display, enable the prop shield, do the ws2812b/apa102 LEDS, disable the prop shield, and re-enable the SPI. This involves some amount of port configuration. I had asked about previously, and KurtE replied with the configuration:
Here is a fragment of the code that I did when I tested it with a 3.2 (I don't currently do both ws2812b and OLED/TFT displays at present). Note, I only use
Adafruit_Neopixel, so you may need to dig into
FastLED to see if there are other things that are needed. Or just don't use SPI displays:
Code:
#ifdef SPI_HAS_TRANSACTION
// Return true if the pin is one of the special SPI0 pins for ouptut
static inline bool
is_spi0_pin (Neopixel_pin_t pin)
{
if (pin < 0)
return false;
#ifdef PROCESSOR_TEENSY_3_X
switch (pin)
{
default:
break;
#if PROCESSOR_TEENSY_3_5 || PROCESSOR_TEENSY_3_6
case 27: // 3.5/3.6 alternate SCLK0
case 28: // 3.5/3.6 alternate MOSI0
#endif
case 7: // alternate MOSI0
case 11: // normal MOSI0
case 13: // normal SCLK
case 14: // alternate SCLK
return true;
}
#endif
return false;
}
#endif
// display the pixels and possibly blink the LED
void
Neopixel_object::show (void)
{
if (lowlevel)
{
#ifdef SPI_HAS_TRANSACTION
bool pin_spi_p = do_spi_reserve && is_spi0_pin (pin_neopixel);
bool pin2_spi_p = do_spi_reserve && is_spi0_pin (pin_neopixel2);
if (do_spi_reserve)
{
// beginTransaction prevents SPI bus conflicts
// We need to reset 11 & 13 to being digital pins
// https://forum.pjrc.com/threads/46640-Neopixels-with-SPI-transactions-on-prop-shield-working-with-ST7735-SSD1351-displays
SPI.beginTransaction (SPISettings(24000000, MSBFIRST, SPI_MODE0));
if (pin_spi_p)
pinMode (pin_neopixel, OUTPUT);
if (pin2_spi_p)
pinMode (pin_neopixel2, OUTPUT);
// Doing uncanny eyes, we need a slight delay after doing the beingTransaction so that the first LED doesn't glitch
if (do_spi_delay)
delay (do_spi_delay);
}
#endif
if (pin_enable >= 0)
digitalWrite (pin_enable, HIGH);
lowlevel->show ();
if (do_blink)
blink ();
if (pin_enable >= 0)
digitalWrite (pin_enable, LOW);
#ifdef SPI_HAS_TRANSACTION
if (do_spi_reserve)
{
// allow other libs to use SPI again
SPI.endTransaction ();
#ifdef PROCESSOR_TEENSY_3_X
if (pin_spi_p)
{
volatile uint32_t *reg = portConfigRegister (pin_neopixel);
*reg = PORT_PCR_MUX (2);
}
if (pin2_spi_p)
{
volatile uint32_t *reg = portConfigRegister (pin_neopixel2);
*reg = PORT_PCR_MUX (2);
}
#endif
}
#endif
}
else
abort_with_message ("Neopixel_object::show, no lowlevel neopixel");
}
Some time ago, FrankB designed a PCB that converted the pinout for 3.6/3.5 to 3.2 for shields like the prop shield that used the back 5 pins. He also put holes in the front for the 4 inner pins (Vusb, Aref, A10, A11) that the prop shield doesn't allow for in case you wanted access to those pins as well:
One other note is the prop shield extends beyond the classic Teensy 3.2 size, adding the breakout pins for Agnd/sound +/sound -/VIN in the front and VIN/ground/11/13 in the back. You need to plan your prop shield to be high enough so you can access the pins in the back.
At the moment, I'm in fact about to solder up a stack with the Adafruit Teensy -> Feather adapter, Prop shield, and the FrankB PCB to sit on top of either a 3.2 or the 3.6 I just added stacking headers to. However, like most of my soldering projects, it goes in fits and spurts.