What can an UNO do that a Teensy 4.0 can not?

jim lee

Well-known member
Read an SD card attached to a DFrobot_0669 Display.

I tried everything I could think of and could not get the Teensy to "see" the SD card. Failed on SD.begin() every time. Wire the thing to an Arduino UNO and presto! Worked first time.

C++:
#include <SD.h>

#define SD_CS     4

void setup() {

File  testFile;
   Serial.begin(9600);
   delay(2000);
   if (!SD.begin(SD_CS)) {
      Serial.println("NO SD CARD!");
   } else {
      Serial.println("Looks like SD card worked!");
      testFile = SD.open("mary.txt",FILE_READ);
      char  aChar;
      while(testFile.available()) {
         aChar = testFile.read();
         Serial.print(aChar);
      }
   }
}

// During loop..
void loop() { }
 
From UNO page
I/O Voltage5V

- SD cards on display boards may not be 3.3V ready. Seems the one on the ili9341 wasn't used without mod
 
Just stabbing in the dark here: did you hard-wire the display's CS so that the display itself is disabled, to make sure that it isn't interfering with any attempts to initialize the SD socket ?? What actual pins do you have connected between the T4.0 & the DFrobot_0669 display ?? Do you have external pull-up(s) on the CS line(s) ??

Mark J Culross
KD5RXT
 
Last edited:
Two problems tend to come up with SD cards used on hardware meant for Arduino Uno.

I tried a quick Google search for "DFrobot_0669 Display" since no info was given about this hardware, and I landed on this page which has a schematic link.

Problem #1: slow voltage translate buffers. Uno's SPI is limited to 8 MHz, so many shields have slow buffer chips because Uno simply can't create higher speed signals. I see this schematic has a buffer chip, U2, but no part number is given. If this is a slow chip, you'll need to use one of the begin() functions in File > Examples > SD > SdFat_Usage which slows the SPI clock.

Problem #2: incorrect power to the SD card when the shield has a voltage regulator to give the SD card 3.3V power, but you provide Teensy's 3.3V as input to the regulator. The regulator always drops some of the voltage, so if you start with 3.3V, the card ends up with less than 3.3V. The solution is the power the shield with 5V.
 
On both setups the display & SD card was powered by 5V.

I tried both ways to test this. With the display running and not initialized. No change.

Also it didn't work on T3.2 or T4.0 it only worked on the UNO.
 
I have two SD cards. Both currently in use by Teensy devices. I've tested with both of these SD cards. Neither work with this setup.
 
In your other thread (for the same problem), you were trying to figure out if the problem was between cardBegin() or Vol::begin()... that's literally what the CardInfo example tests for. I guess this new thread is just for complaining rather than troubleshooting.
 
Neither work with this setup.

Yeah, a product meant for slow 5 volt Arduino Uno that was never designed to work with a fast 3.3V board like Teensy, indeed does not work with Teensy.

You have two basic options to move forward from here.

1: Abandon it and find something else that does work with Teensy.

2: Deep dive into discovering the technical reason and try to modify the hardware or connect it differently so it can work with Teensy.

We can probably help you with either path. If you want to find something, perhaps if you explain what you're trying to accomplish and give interesting context about your project (so people are actually interested) there's a good chance people here familiar with many alternate products might chime in with recommendations of things they have personally used.

If you want to go the technical route to modify this incompatible hardware, hopefully you can understand how fruitless simply saying it doesn't work is. Nobody can meaningfully help with virtually zero info. I tried to explain the 2 most common problems, but that's as much as I can do when I can't even see the hardware you really have. Like giving context that would get people interested in helping you find other products that are compatible, you're dealing with real human here. We're not bots. If you want us to put real human time into helping, you need to make a good impression (or at least not a bad impression). Only complaining that something doesn't work isn't helping and might push away people who would otherwise help. Showing detailed into and demonstrating that you've actively trying to solve the problem but need a hand is the way to approach this sort of conversation. We're real humans who respond favorably to people who make an earnest effort, and respond not so well when everything appears to be just complaining without even giving links to info, photos of your efforts, and so on.

I want to help you, and at this point I've done everything technical I can, so this message mostly about how to communicate effectively on a tech forum is pretty much the only thing I can do.
 
Note: In the past I have had issues with SD adapters, like ones from Sparkfun that had level shifters in them. Worked fine on their
non-level shifters version. If I remember correctly the Adadfruit one with level shifters usually works.

However I believe you needed to wire those with 3.3v to the 5v pin on the adapter, as this feeds the level shifter chip, so for example
the MISO pin coming back from the adapter would be at 3.3v and not 5v... They also used a very low drop... Voltage regulator, which
could handle input voltages down to 3.3v and still output 3.3v...

With yours, not sure if feeding 5v into the display and the like, will cause some of the IO pins like MISO to be driven to +5v which
is probably not a good thing.

Good luck
 
I'm not going to deep dive it. This was post was mostly a "Look, this is what I found." I figured the only ones that would care, would be you. You ARE Teensy. You align yourselves with Arduino libraries.

So I'll drop this display. For some reason, it doesn't work.

All I was trying to do was come up with a better display to use with my stuff. Right now the best touch screen I have is the old Adafruit UNO shield and that's 240x320. This one looked like a good option/upgrade.

As for being interesting, I was told here, back in the day, to show the error on the simplest code possible. So that's exactly what I did. As for being interesting? Really?

Ok, fine this is what I'm doing.

The left coast library docs.

I'm working on a set of libraries for the Arduino. Developed almost entirely on Teesny 3.2s. It starts with a set of tools to solve a bunch of standard issues people run into every day with Arduino programming, and can be used by anyone. There is a bunch of stuff for different purposes. Put them all together, and you get a standardized environment that allows multiple sketches to run and communicate with each other on a home made handheld device.

Is this interesting to you? Probably not. But its very interesting to me and rely heavy on it for every thing I write.
 
That looks like the same adapter. Kinda' more squared off than the one Adafruit uses. It says I can have it by tomorrow. Maybe I should give it a test? It costs's less than lunch.
 
Which I believe is the same one that Proto Supplies puts on some of their boards.
Seems like. Bought one here and it works likes the ones @KenHahn sells. Seems it came in the same plastic box and label.

Nice IPS 3.5" display and has wide view angle - readable at odd desk angles.

Paired with a T_4.1 not sure if Ken ever wired up and tested SPI SD adapter?
 
The one I sell has a 74LVC245 high-speed buffer chip which we have run the SPI at 80MHz to the display, so the SD should work with Teensy from that standpoint, but I haven't tried it. The one from Amazon does appear to be the same display.

A little more info about that ST7796 display can be found here: https://protosupplies.com/product/ips-35-st7796/

For any of you with my Mini Platform, the display SD card CS is not connected since everyone 'should' be using the built-in SD card on the Teensy 4.1 since it is faster. If you wanted to play with it, you'd need to tack on a wire.
 
Ok thanks, your's looks exactly like the one defragster pointed out to me. (And I grabbed from the Amazon link) If I'd realized you were a poster here, I would have grabbed yours, sorry.

I'm off to the shop to wire this thing up to my Teensy. Then we'll see if I can get it to work.

BTW can you get them without the header pins?

Edit : Lake Stevens?! Heck I can just drive down and pick up a few! I'm in Anacortes!
 
Last edited:
As far as I have been able to determine, these all appear to be built at the same factory and they all come with pins preinstalled.

You can find quite a bit of misc info on these display on the LCDWiki site which you might find useful if you haven't seen it: https://www.lcdwiki.com/3.5inch_IPS_SPI_Module_ST7796

Keep us posted on how you make out with the SD card on these displays. I forgot that I had not actually tested it until this thread, so will update the website depending on what you find.

Yep, I'm just about an hour down the road in Lake Stevens.
 
I have both resets both pulled HIGH through pullups and have never seen an issue after a lot of testing. If you do want to toggle them, I would expect that you could connect both together on the same line.

Here is how I have it connected.
Mini Platform LCD Schematic.png
 
SD card works!

Now I have to get the screen to do what I want. But now there's a lot more info. out here, for me to poke around in.

Thank you all very much!
 
Good to know. Something that trips everyone up the first time with this LCD is is that you have to invert the colors or they will be wonky.

tft.init(320, 480);
tft.invertDisplay(true);
 
I saw the invert thing. Wondered about it. Clipped off the reset wire just to realize I clipped the D/C line. I think it's time to find lunch.

Thanks again.

Oh and the tft.init() sends stuff to the Serial port. Is that something you want to happen?
 
I'm not sure why that is in there. Prints "ST7796_t3::init mode: 0". Maybe debug code that got left in?

void ST7796_t3::init(uint16_t width, uint16_t height, uint8_t mode)
{
Serial.printf("ST7796_t3::init mode: %x\n", mode);
 
The one I sell has a 74LVC245 high-speed buffer chip which we have run the SPI at 80MHz to the display, so the SD should work with Teensy from that standpoint, but I haven't tried it. The one from Amazon does appear to be the same display.
I thought the speed limit for SPI was officially 30MHz. Maybe it could go up to 40. How well does 80MHz work? I've never actually tried going past 40.
 
Back
Top