A couple of questions to help me on my way

Status
Not open for further replies.

sparx266

Member
Hello all

Bit the bullet and got a couple of Teensys, so need to get a few newbie questions answered.

First up, I need to drive a '595 shift register, it MUST be at 5V, I'm using a T3.6 therefore 3.3V, was thinking to use a level converter, can 5V be tapped off from anywhere? Will be using USB power so am thinking VUSB pin outputs 5V? Is there a more preferred/better way of doing level shifting on a 3.6?

Second, got an ILI9341 320x240 2.8" touch TFT Display, what value resistor to use with for the backlight please? Again this will be with the T3.6. Is the backlight powered from 3.3V?
Related to the above, is there any example code that will display a graphic (BMP, JPG) stored on the T3.6 SD card?
Hopefully these are easy to answer questions for those with prior experience.

Thanks in advance.
 
can 5V be tapped off from anywhere?

Either VIN or VUSB pins. Refer to the schematic for details.

https://www.pjrc.com/teensy/schematic.html

Is there a more preferred/better way of doing level shifting on a 3.6?

Usually using 74HCT or 74AHCT logic family is the best way. The "T" means TTL level, so anything over 2.0V will be recognized as logic high.

Fortunately, the 595 shift registers are readily available in 74HCT form...

https://www.digikey.com/product-detail/en/nexperia-usa-inc/74HCT595D118/1727-2857-1-ND

If you do use a level shifter circuit, be aware that the cheap ones with a mosfet and 2 resistors are speed limited. Teensy 3.6 can toggle its pins much faster than those circuits are able to work. Delays in the code will almost certainly be needed if you go with that type of circuit between Teensy and '595 shift registers.


Second, got an ILI9341 320x240 2.8" touch TFT Display, what value resistor to use with for the backlight please?

100 ohms is a good first try.

On some of those displays, the LED pin connects directly to the LED backlight. Some have a resistor built in. Some have that pin connected to a transistor which controls the backlight.


Related to the above, is there any example code that will display a graphic (BMP, JPG) stored on the T3.6 SD card?

Yes, Adafruit's "spitftbitmap" example is included with Adafruit's original library and with ILI9341. Access is from Arduino's menu by clicking File > Examples > ILI9341_t3, or File > Examples > Adafruit_ILI9341.

I do not recommend attempting to use the SD card socket on any of those displays. Some do work, but many of those displays have series resistors or other design problems where the SD socket doesn't work at the faster 24 MHz SPI speed Teensy uses.

Teensy 3.6 has a built in SD socket. Use "BUILTIN_SDCARD" for the CS pin. Open any of the SD examples (File > Examples > SD) and read the comments for details.
 
Regarding the displays I generally connect the backlight pin to a digital pin, that way I can turn the display on/off or even write PWM to the pin to control brightness--my favorite is to use the touch screen where dragging a finger up increases brightness. I've found that using the displays SD card required removing the resistors R1 R2 R3 and soldering directly across them, and soldering closed J1. Paul has much more experience than I but this process seemed to work for me. However one issue with some displays is the ability to get a pixel--I have a written a "screen capture" that gets all pixels and saves to a BMP file. Some displays get pixel works, others not...
 
Worked first attempt!

Just in case anyone else needs to know and is using a Hiletgo 320 x 240 from Amazon.

VCC - 3.3V
LED resistor 100 ohms also to 3.3V.

Not tried to the touch part yet, like the idea of variable screen brightness...

Thanks again.
 
Status
Not open for further replies.
Back
Top