2.2 TFT display and MISO

by corbin on Mon Nov 19, 2012 2:14 am

Hi,
I have the 2.2 TFT display. I'm trying to read data from the display based on the data sheet at:

http://www.adafruit.com/products/797

I modified the code to do something like this:

writeCommand(HX8340B_N_RDDCOLMOD);
SPDR = 0;
while (!(SPSR & _BV(SPIF)));
byte value1 = SPDR; // SPI.transfer(0);

SPDR = 0;
while (!(SPSR & _BV(SPIF)));
byte value2 = SPDR; // SPI.transfer(0);

Which should read the two bytes from the RDDCOLMOD command (read the color mode).

However, I always get 0 back.

This has me wondering...is the TFT's SDO hooked up to MISO? Or, is the MISO output for the shield *only* for the microSD? I can't quite tell by looking at the board. Anyone know?

thanks
corbin
corbin
 
Posts: 3
Joined: Sun May 13, 2012 2:43 pm

Re: 2.2 TFT display and MISO

by adafruit_support_bill on Mon Nov 19, 2012 5:56 am

Haven't tried reading from the display. The board files and schematics are here.
User avatar
adafruit_support_bill
 
Posts: 28118
Joined: Sat Feb 07, 2009 9:11 am

Re: 2.2 TFT display and MISO

by corbin on Mon Nov 19, 2012 11:29 am

Thanks! That answers my question; according to the BTL221722-276L data sheet, the SDI pin is the "Serial data input/output PIN" -- so I guess it goes both ways. And yes according to the schematic the SDI pin is obviously hooked up (to MOSI) as it gets data in.

So...in theory I should be able to read stuff off the display, but I can't get it working.

My goal is to detect if the display is initialized, and if not to initialize it. This would allow "hot swapping" of the display.

Let me know if anyone has hacked the code to read from one of these displays.

-corbin
corbin
 
Posts: 3
Joined: Sun May 13, 2012 2:43 pm