Saturday, August 30, 2014

Arduino + TFT LCD

I happened to find this 2.8 " TFT LCD on ebay here manufactured by a chinese company called ARMJISHU. The only way i came to know about this TFT was because of the fact that the manufacturers were generous enough to put their website url on the PCB silkscreen. If this detail would not have been there i would never have known what display driver chip it runs or what touchscreen driver it uses. If you head over to the ARMJISHU site it's all in chinese and i could not find this tft sold as a separate product. It was however sold as a part of their STM32 kit. It was in the CD for this kit (which was a whopping 1.2 GB download from the site) that i found the source code for all the peripherals used by the kit and in the tft example i found that the driver was a SSD1289 and a ADS7843 touch controller. 



Once you know the controller it is pretty easy to find the Arduino drivers for the same. I hooked up the tft to the Arduino MEGA and was able to run some sample code using the UTFT library. The touchscreen never worked with this library from elechouse. I am guessing it's damaged. I saw many posts on the internet about people not being able to use this TFT just because they could not find details about it. I hope this post serves as a reference, if they find this post ;)


 The connections for the ATMega 2560. The colored names are the pins on the TFT header. CS is actually named LCD_CS on the tft pcb. RD pin on the tft header has to be directly connected to 3.3V.


The output. Something does not seem right ? Can you guess the last number in the sequence ?

The hookup guide for the TFT using the Mega can be found in the UTFT pdf manual. The code i used is just the example available in the UTFT lib. One has to just uncomment the Arduino Mega API call and comment out the Uno one. The first parameter to the class variable declaration has to be set to the display model, in this case SSD1289.

Update
While using the ADS7843 library from the link mentioned above you might get some errors in ads7843.h like:

ads7843.h:34: error: ISO C++ forbids declaration of 'Pio' with no type
ads7843.h:34: error: expected ';' before '*' token

In order to fix this, open the ads7843.h file and comment out the line as shown below (the second line too
is of no use hence comment that as well)
 

Next, open ads7843.cpp file and disable the code shown below from the class constructor


The compilation should now be successful...

Visible Light Communication Chronicles - Part IV - The Photodiode

In this post i will compare the new ambient light sensor that i got - the TEMD 6200FX01 by Vishay to the TEMT 6000 phototransistor [PT]. The TEMD6200FX01 is a PIN photodiode [PD]. More information can be found in its datasheet here. The circuit i hooked up with the PD is shown below.






The PD is reverse biased with a voltage of 3.3V and the output is taken across the 10K load resistor. Looking at the reverse voltage vs capacitance curve from the data sheet i approximated that the diode capacitance will be around  30 pF. The load resistor and the capacitance will determine the cut-off frequency and the time constant. Based on above values these turn out to be as shown below


Hence the cut-off frequency happens to be approximately around 530 KHz with this configuration of the PD.
The LED was modulated with different frequencies and the light was focused on both the PD and the PT. The below waveforms were observed on the scope. The orange trace is the PT output and the blue trace is the PD output. (In case of the PT the circuit is same as before and the output is obtained across a 10K resistor). It was pointless to go beyond 10KHz as the PT output faded away.

100 Hz square wave


1 KHz square wave

10 KHz square wave


The board i designed for mounting the TEMD 6200 0805 SMD so that i could breadboard the test circuit


In the next chronicle i will be hooking up the PD to a transimpedance amplifier...