Forum Rule: Always post complete source code & details to reproduce any issue!
-
Appropriate Level Shifting IC to interface Teensy LC to 5V chip
I'm looking to use a Teensy LC to controll an old 5V logic chip which is something I've never done before. The target chip has got 8 inputs and no outputs back to the Teensy (so I'm only 'writing' to the chip not 'reading' from it) so as far as I'm aware I need a uni-directional level shifter.
Would the 74HC244N be an appropriate chip to do this, if I feed it 3.3V on the inputs and give it 5V in Vcc will it punt out 5V signal on the outputs? OR have I got completely the wrong end of the stick?
-
What chip actually is it?
Many 5v chips are quite happy with 3.3v logic inputs. Have to check the data sheet to be sure.
-

Originally Posted by
Cosford
What chip actually is it?
Many 5v chips are quite happy with 3.3v logic inputs. Have to check the data sheet to be sure.
Thanks for that, it turns out I am an idiot, you made me re-read the datasheet and I had overlooked a table first time round - min voltage for input high is 2V so I am good to go.
-
Senior Member
If you do run into a 5V chip that requires more than 3.3V for logic high, the best unidirectional chips are the ones with the letter "T" in the part number. So 74HCT244, 74ACHT125, etc.
-
Junior Member
Not to go too much out of line with the thread but may I ask if these would work fine for Teensy 3.1 and APA102C LEDs ?
-
Senior Member
FWIW, I am waiting to run a APA102 based device with these translator chips in the near future. I'll try to remember to report back if it works! Constantin
-

Originally Posted by
PaulStoffregen
If you do run into a 5V chip that requires more than 3.3V for logic high, the best unidirectional chips are the ones with the letter "T" in the part number. So 74HCT244, 74ACHT125, etc.
Thanks for that info, I presume from reading this datasheet http://www.nxp.com/documents/data_sheet/74HC_HCT244.pdf that the T must stand for TTL level?
If I did need to go in the other direction would a simple voltage divider work for going from 5V to 3.3V into the Teensy?
-
Senior Member

Originally Posted by
Alistair Sheehy Hutton
If I did need to go in the other direction would a simple voltage divider work for going from 5V to 3.3V into the Teensy?
Teensy 3.1 has 5V tolerant digital pins. You can connect 5V logic signals directly. Only the digital pin have this, so don't drive the analog only pins this way.
For Teensy-LC or Teensy 2.0 at 3.3V, resistor dividers work if you can live with slow speed and wasted power when the signal is high. For high speed, a 5V tolerant logic chip is best. My favorite is usually 74LCX.
Last edited by PaulStoffregen; 07-10-2015 at 11:40 PM.
-
Senior Member+
When Paul mentioned LCX some time ago, I googled a bit and found this selection guide:
https://www.fairchildsemi.com/collat...tion-Guide.pdf
(When i first used logic-chips, "LS" was common...later "HC" or "HCT".. then I had for a long time other hobbies)
-
Senior Member
Another working levelshifter
Being curious, I tested an NXP 74AHCT2G125/TSSOP8 levelshifter to connect an APA102 LED to a Teensy 3.1.
Here is the datasheet: NXP 74AHCT2G125.pdf. Ordered a 5-pack at http://www.aliexpress.com/item/Elect...357109273.html.
I mounted this levelshifter on a small adafruit breakout board: http://www.adafruit.com/products/1212.
Here is the complete test setup:
.
Red wire is +5V, black is GND, green is SCK, yellow is MOSI.
Works like a charm, 24MHz SPI clock is no problem. I checked the signal waveforms on a oscilloscope: the outputs of the levelshifter actually have shorter rise/fall times than the SPI outputs of the APA102!
Here is the code I used for testing:
Code:
#include <SPI.h>
// hardware SPI on Teensy 3.1: MOSI pin 11, SCK pin 13
SPISettings APA102(24000000, MSBFIRST, SPI_MODE1);
void setup() {
SPI.begin();
}
void loop() {
SPI.beginTransaction(APA102);
SPI.transfer(0); // 32bits start frame APA102
SPI.transfer(0);
SPI.transfer(0);
SPI.transfer(0);
SPI.transfer(255); // upper 3 bits: 111, lower 5 bits: brightness
SPI.transfer(0); // blue
SPI.transfer(0); // green
SPI.transfer(192); //red
SPI.transfer(255); // 32bits end frame APA102
SPI.transfer(255);
SPI.transfer(255);
SPI.transfer(255);
SPI.endTransaction();
delay(500);
}
Paul
-

Originally Posted by
PaulS
Being curious, I tested an NXP 74AHCT2G125/TSSOP8 levelshifter to connect an APA102 LED to a Teensy 3.1.
Here is the datasheet:
NXP 74AHCT2G125.pdf. Ordered a 5-pack at
http://www.aliexpress.com/item/Elect...357109273.html.
I mounted this levelshifter on a small adafruit breakout board:
http://www.adafruit.com/products/1212.
Here is the complete test setup:

.
Red wire is +5V, black is GND, green is SCK, yellow is MOSI.
Works like a charm, 24MHz SPI clock is no problem. I checked the signal waveforms on a oscilloscope: the outputs of the levelshifter actually have shorter rise/fall times than the SPI outputs of the APA102!
Here is the code I used for testing:
Code:
#include <SPI.h>
// hardware SPI on Teensy 3.1: MOSI pin 11, SCK pin 13
SPISettings APA102(24000000, MSBFIRST, SPI_MODE1);
void setup() {
SPI.begin();
}
void loop() {
SPI.beginTransaction(APA102);
SPI.transfer(0); // 32bits start frame APA102
SPI.transfer(0);
SPI.transfer(0);
SPI.transfer(0);
SPI.transfer(255); // upper 3 bits: 111, lower 5 bits: brightness
SPI.transfer(0); // blue
SPI.transfer(0); // green
SPI.transfer(192); //red
SPI.transfer(255); // 32bits end frame APA102
SPI.transfer(255);
SPI.transfer(255);
SPI.transfer(255);
SPI.endTransaction();
delay(500);
}
Paul
Pauls, please take another look at the spec sheet for that chip, the recommended minimum voltages for VIH is much higher then 3.3V logic at 5.5V(3.85V), if you use that to level shift 3.3V to 5V logic you may run into issues later on.
-
Administrator

Originally Posted by
Donziboy2
VIH is much higher then 3.3V logic at 5.5V(3.85V)
Perhaps you're reading the specs for 74AHC2G125 on page 4 ?
This datasheet covers 2 different part numbers. The specs for 74AHCT2G125 (with the letter "T" in the part number) are on page 5. VIH is 2.0 volts.
-
Senior Member
Donziboy2, you may looked at the wrong place in the datasheet; I'm using the 74AHCT2G125 [the T version]. On page 5, it states "min 2.0V at 4.5-5.5V".
Paul
-
Senior Member
Crossed
-
Ah ok, I hate when they combine multiple products into one spec sheet.
-
Last edited by doughboy; 07-29-2015 at 04:50 PM.
-
Senior Member
I don't doubt the 74..T.. is the best for unidirectional level translation but it is not the only; I have used this guy with success with PWM and tested it at 3 MHz with good results. The only possible advantage is eight channels in an appallingly small package. Otherwise stick with the 74...T...
-
Administrator

Originally Posted by
doughboy
These mosfet+resistor level shifters have terribly slow rise times. They really only work well for I2C, but sadly they are commonly marketed and misunderstood to be a "universal" level shifting solution. They're not!
They not be used for SPI or any addressable LED protocols or other high-speed communication.
For addressable LEDs like APA102 & WS2812 (Adafruit Dotstar & Neopixel), unidirectional buffers are the most appropriate choice for 3 to 5V conversion.
-

Originally Posted by
PaulStoffregen
Teensy 3.1 has 5V tolerant digital pins. You can connect 5V logic signals directly. Only the digital pin have this, so don't drive the analog only pins this way.
For Teensy-LC or Teensy 2.0 at 3.3V, resistor dividers work if you can live with slow speed and wasted power when the signal is high. For high speed, a 5V tolerant logic chip is best. My favorite is usually 74LCX.
One question about the 74LCX, I had a quick look and none of them seem to come in" fat finger bad at soldering friendly" DIP packages, they all appear to be surface mount Have I missed an appropriate family member or do I have to look elsewhere?
-
Senior Member+

Originally Posted by
Alistair Sheehy Hutton
One question about the 74LCX, I had a quick look and none of them seem to come in" fat finger bad at soldering friendly" DIP packages, they all appear to be surface mount Have I missed an appropriate family member or do I have to look elsewhere?
These SOIC Packages are easy to solder. If you can solder DIP you can solder SOIC too :-) Give it a try !
Last edited by Frank B; 07-30-2015 at 12:19 PM.
-
I’m looking to connect the emic 2 to a Teensy. Documentation implies I need tx and rx to use this. I don’t have any dedicated level shifter gadgets handy. I have killed a couple of Teensies with higher supply voltage encounters (and feel very guilty) and know they are delicate flowers. What is the prudent thing to do?
Thanks,
Ben
-
What about these - TXB0104 Bi-Directional Level Shifter? Would they be\ any good on ttl rs232?
-
Yep! I made an online purchase for one of these.
In the meanwhile I am testing the emic 2 with an old Tessel. The speech board does seem to work when powered with 3.3v.
(see fritzing here https://github.com/pirumpi/emic2)
I believe the only loss is some loudspeaker volume, which is fine.
Nonetheless, I am loathe to hotwire it like this with a new Teensy.
-
... and the serial com on the emic is so slow I don't think a generic level-shifter would cause any drag, but Paul may be right about wasting current...
-

Originally Posted by
Alistair Sheehy Hutton
One question about the 74LCX, I had a quick look and none of them seem to come in" fat finger bad at soldering friendly" DIP packages, they all appear to be surface mount Have I missed an appropriate family member or do I have to look elsewhere?
Its very rare that a new chip come in anything but surface mount, through hole is for legacy devices (new
opamps sometimes have DIP versions for upgrading old kit). The 3.3V CMOS logic families are all new
enough to be in the era of SMT.
With enough flux and not too much solder SOIC is straightforward to solder, and adaptors from SOIC to DIP are
quite easy to find too.
With a hot air rework station and pre-tinned pads or solder-paste stencil most SMT packages are solderable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules