Re: How many and which PINs free?

Date: 2015-03-19 10:44 am (UTC)
dawnmist: My homebuilt gaming keyboard - version 1 (0)
From: [personal profile] dawnmist
For these displays, you need to use the underside pads on the teensy to be able to have enough pins - some of the screen data lines use the underside pads.

There's 16 data lines (digital) + 5 control lines for the screen (also digital - and a 6th line that is connected to 3.3V to keep the screen in write mode), and 4 lines for the SD card. If you want to use the touch, there's either another 2 lines if you can get the SPI to share between the SD and the touch interface (I couldn't with the version of SDFat I was using), or 5 lines to talk to the touch.

That means you'll have up to 30 digital lines in use for the screen, SD and touch. 25 if you're not using the touch, and 27 if you manage to get touch and SDCard sharing the SPI port properly.

There's 34 digital input/outputs in total, so that leaves you with 4 available if you're using the touch as well on separate pins. There's also 4 analogue input ports and 1 analogue input/output port (which has a DAC to generate a "true" analogue signal) free to use.

If that's not going to be enough free, you can get alternative screens that don't need the 16 data lines. I think Adafruit have one that uses 8 data lines instead (plus a few control lines), and there are some screens that use SPI to communicate to them too.

For the 16-data-line screen using the UTFT library, the required pins are the first 8 pins of Port D, and 2 sections of 4 pins from Port B (documented at: http://forum.pjrc.com/threads/18002-Teensy-3-0-driving-an-SSD1289-with-utft?p=34719&viewfull=1#post34719 and http://www.dawnmist.net/teensy/HW_Teensy3.h - note that there is no longer any need to patch the UTFT library as the Port B/D variant has become an official part of the library).
* Port D (0-7) = DB_8=2, DB_9=14, DB_10=7, DB_11=8, DB_12=6, DB_13=20, DB_14=21, DB_15=5
* Port B (0-3,16-19) = DB_0=16, DB_1=17, DB_2=19, DB_3=18, DB_4=0, DB_5=1, DB_6=32, DB_7=25

If you want to be able to adjust the brightness, LED_BL needs to be connected to a PWM pin (I used pin 9). In the end, I found I just wanted it to be full brightness though, so it didn't really matter that much.

The SD card needs to use SD_DOUT(MISO)=12, SD_CLOCK=13, SD_DIN(MOSI)=11 if using the Teensy's native spi port. These would be the pins that would be shared with the Touch interface *if* you can get SPI sharing working properly (I think the SD library - as opposed to the SDFat library - has been adjusted so that it may work with SPI sharing now). The SD_CS (chip select) pin can be any of the other digital pins - I used pin 10 (which was the default CS0 for the SPI port).

The other pins are all free to make your own choice with.

Pin diagrams: http://www.pjrc.com/teensy/pinout.html

Good luck, and I hope you have fun with your project. :-)
This account has disabled anonymous posting.
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Profile

dawnmist: My homebuilt gaming keyboard - version 1 (Default)
Dawnmist

February 2017

S M T W T F S
   1234
567891011
12131415161718
19202122232425
262728    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Wednesday, March 11th, 2026 07:14 pm
Powered by Dreamwidth Studios