which Teensy are compatible with Arduino ?

Status
Not open for further replies.

jasmino

Member
Hey folks,

I'm looking into using a Teensy, for an application that will have to do a lot of manipulation, quite fast.

I'm quite familiar with Arduino, but I'm just wondering if Teensy, when using Teensyduino, is very similar to an Arduino, in terms of programming ?

Can most Arduino library be used ?

Are all Teensy supported ?

What else should I pay attention to ?

Thanks !
 
If you find anything that is not Arduino Compatible Paul would like to know ASAP - in general "C/C++" programming where not hardware specific.

Only major exception is hardware based. Teensy is 32 bit ARM - and has many modified or custom versions of the libraries that install with TeensyDuino.

The core Arduino is based on the AVR (slower 8 bit) processors and at a high level the libraries are compatible as noted in line #1 - when there are low level AVR specific ASM, speed dependent, or direct use of AVR hardware registers or features in use an outside library will be affected and will need to be modified or a Teensy compatible version found.

Hopefully that is good, correct and complet(ly general answer).

If you have specific devices or interfaces in mind . . .
 
there shouldn't be anything very complex: I will use

1 x I2C as a master,
1 x I2C as a slave (talking to a RPi)
and drive roughly 768 x WS2812B LEDs

Talking about WS2812B, can I still use Adafruit's library or you would recommend another one (such as FastLED instead) ? I'm a bit concerned by the fact that the Teensy have a 3V output, vs Arduino which is 5 V . Any advise ?
 
Advice - Be careful with 5V and which Teensy you pick. T_3.6 and T_LC won't tolerate 5V, T_3.5 and T_3.2 will tolerate 5V on digital pins ( as noted on the SPEC Cards ).

The forum is full of threads and details that may help and relate to your uses. Best advice on searching for 'PJRC Teensy'- Use BING or that gOOgle thing.
 
there shouldn't be anything very complex: I will use

1 x I2C as a master,
1 x I2C as a slave (talking to a RPi)
and drive roughly 768 x WS2812B LEDs

Talking about WS2812B, can I still use Adafruit's library or you would recommend another one (such as FastLED instead) ? I'm a bit concerned by the fact that the Teensy have a 3V output, vs Arduino which is 5 V . Any advise ?

Note on Teensy's i2c, there are two libraries. The standard (Wire.h), and a more complex Teensy oriented version (i2c_t3.h). If you are using 2 i2c buses (one for master, one for slave), you probably need to use i2c_t3.h. Note, the two libraries are incompatible. This means you will need to go through any libraries that use Wire.h, and convert it to i2c_t3.h. If you do use 2 i2c buses, the Teensy 3.5 and 3.6 are simpler because 2 of the i2c buses are on the main row of pins. On the 3.2, the second i2c bus is on solder pads underneath the Teensy.

However, if you are talking to the RPI, it may be simpler to use a different type of communication, such as a serial port. Then you don't have to switch to i2c_t3.h. Another method might be plugging the Teensy's usb cable into the Pi, and use serial communications via USB.

Note, if your devices don't have pull-up resistors, you will need to add 2 pull-up resistors, one between the SDA pin and 3.3v, and the other between the SCL pin and 3.3v. Generally 2.2K is a good value. The 4.7K that is used for 5v devices like the Arduino, will work, but it won't let you go to the faster i2c speeds if it matters.

For 768 WS28128B leds, I would recommend looking at the Octows2811 shield and library. It drives the LEDs in 8 parallel streams, and uses all of the features of the Teensy (dma, etc.). It also has the appropriate level shifting built into the shield. Note, the Teensy LC cannot be used with the Octows2811 shield. The downside of the ws2811 shield is the pins for the 8 streams are fixed. Consult the page for suggestions about wiring, etc:

If you don't want the shield, you do want to use the 74HCT245 level shifter, which is fast enough to drive WS2812B leds. The bi-directional level shifters meant for i2c/spi might not be fast enough for the leds (I have found that for under 100 LEDs, the pololu.com level shifter did seem to work, but when you are dealing in hundreds of LEDs, you need to pay more attention to speed).

It is simpler if the i2c device you are talking to can run at 3.3v. Otherwise you will need to use a bi-direction level shifter for that.
 
Last edited:
Do not use Adafruit's library if you are also using I2C slave mode. It block interrupts, which will prevent slave mode I2C from responding.

FastLED is questionable. It might work, but I would not recommend it for this project. If the I2C interrupt takes too much time, it will disrupt FastLED's output. Many people have run into this interrupt timing conflict.

OctoWS2811 will work. It does not block interrupts while the LEDs update, so you can use the I2C ports at any time.

Teensy 3.5 is the easiest model to use. It has three I2C ports, and it has plenty of RAM. It is 5V tolerant, which makes for easy interface to an Arduino board using 5V signals.

Teensy 3.2 could also work. But it's 2nd I2C is only accessible on the bottom side pads, which are not nearly as easy to access as the regular pins on the sides.
 
If you're going to put it on top of the Octo board, don't forget to buy a pair of the 14 pin sockets and a pair of the 14 pin double headers. Together they allow you to mount the longer Teensy 3.5 above the Octo board, where the SD card end overhangs the RJ45 connectors.

octo28_adaptor_8.jpg
 
done...went for the 3.6 ... One can always use more HP !

Paul: I Assume I can use Arduino IDE as usual....no fancy learning or anything special ?!?
 
anything special ?!?

Well, Teensy 3.6 is not 5V tolerant. So you will need to be careful if interfacing it to an Arduino board which has 5V signals. Applying those 5V signals to the pins on Teensy 3.6 can damage the chip.

On the plus side, Teensy 3.6 is even faster with even more memory and use USB host. :)
 
Well, Teensy 3.6 is not 5V tolerant. So you will need to be careful if interfacing it to an Arduino board which has 5V signals. Applying those 5V signals to the pins on Teensy 3.6 can damage the chip.

I assume that this statement also apply for the Pull-ups that are required with I2C.

If Teensy is 3.3V and Arduino 5V, do you have a typical circuit that one can use to connect them together ? Is the 74HCT245 level shifter solution also applicable for I2C ?

Tks
 
? Yes, if you use 5V I2C.
Search for "I2C levelshifter" - there are plenty, because this is a common issue with decades old outdated 5V hardware.
 
Frank B: Thanks !

Just ordered some free sample at ti.com for some "PCA9306DCTR-2-Bit Bidirectional I2C Bus and SMBus Voltage-Level Shifter"
 
Status
Not open for further replies.
Back
Top