This page is still under construction, but I am updating it regularly. Here I will gradually consolidate information related to programming TFT graphic interface with touchscreen function. The project based on free Graphic Libraries developed by Microchip. The libraries are updated on regular basis which brings some new functionality, but also creates some issues related to compatibility with previous releases. I have also realized that it would be a good idea to document most critical stages of the project since details and findings witch seemed to be quite clear in the past, have a tendency to fade away and when creating new project you may spend a lot of time re-inventing the wheel.
The device you see on the picture is my latest project. This Hand-held Vector Network Analyzer I built based on UBW32 USB Bit Whacker and five inch TFT Display with SSD1963 controller with Touchscreen pad, see pictures below. The displays are easily available on e-Bay for $40-50. I use ICD3 programmer/debugger from Microchip and my first project based on Mikroe Multimedia board. The board had integrated controller PIC32 MX460F512L and a lot of features including M25P80 8MBit flash memory chip. Other features, like MP3 Codec chip I do not use. The main disadvantage is relatively small (3″) display and its price which, including shipping from Europe to Canada, amounting $130. Microchip development tools work well with their Graphic Libraries, but to obtain decent image quality a graphic controller required. I did not manage to achieve acceptable image quality with Low Cost Controllerless board (LCC) which is actually not too cheap – $90. Beside of that, Microchip does not produce graphic boards with integrated micro controller. It has to be combined with separate board such as a Starter Kit or Explorer or similar. In any case, the project will cost you around $300. I also considered the fact that displays and graphic controllers used in Microchip Development Tools are NOT easily available. Though, the software is virtually free if you use evaluation version of C compiler. That is why I decided to stick to PIC controllers. TechToys offer TFT displays and boards with SSD1963 display controller. I tested EVK for Solomon SSD1963 Ultima R4.1 and EVK for Solomon SSD1963 Display Controller R4A They work quite well, but a cost of Ultima board with 5″ display is $129 plus a Start kit with controller required. The total would be $180. R4A board and 5″ display cost $79 + plus controller ~$40. And it would be not too easy to fit the bundle into box since display flat cable well offset from the centre. Since I plan to produce small series of instruments with graphic interfaces, I decided to research for inexpensive off the shelf solutions. Currently I use a hardware which consists of 4.3″, 5″ and 7″ TFT displays with SSD1963 controller which are cheap and easily available. Five inch display cost on eBay $40-50, seven inch – $50-70. They all mounted on a board with 40 pin connector, touchscreen and display controllers. I tried all available sizes from 4.3″ to 7″ and found them fit my needs. Currently I work with 5″ display iwth 480 x 800 resolution.
A driver for SSD1963 controller not included in Microchip Libraries for Applications (MLA) but it is available on TechToys site. I use Object Layer project for Ultima board: GOLDemo PIC32MX795F512L SSD1963 Ultima R4. In HardwareProfile I also uncommented #define EXPLORER_16, #define ULTIMA_R4_BOARD and #define USE_TY500TFT800480. The display boards are equipped with XPT2046 touchscreen controller chip which is neither supported by TechToys nor by Microchip. So I had to write my own routines to handle the controller. The routines are added to Main file instead of TouchScreen and TouchScreenResistive, which were removed from the project. Actually, at the beginning I attempted to modify the touchscreen driver files in order to adapt them to XPT2046, but I found the code is so complicated and unfriendly (may be to me only), so finally I gave it up and wrote my own. After adding 40ms delay after EVENT MOVE line in TouchGetMsg(), the touchscreen works very smoothly. The display board provides a landing print for Flash memory chip. I solder M25P80 there since I already have driver files for the chip. I use bit-bang technique to control the memory chip, therefore it is quite important not to overclock it. To slow down the bus following line was added to Main: mOSCSetPBDIV(OSC_PB_DIV_2); Currently the hardware with 5″ touchscreen display cost me $80 ($40 – display and $40 the UBW32 board).
Note that the display coming without Serial Flash memory chip (U1 on the top left, next to SD bay). Eight Mb M25P80 was installed there to store touchscreen and VNA calibration data as well as frequency ranges. Recently I developed and manufactured an adapter board allowing connecting a flat cable between display and a UBW32, see pictures below.
Project files and adapter boards are available upon request.
Connections between the Display and UBW32 shown on this file.
This graphic interface is used in my N2PK Hand-Held VNA.
A touchscreen driver code snippet is HERE.
Here is a link to the fully functional project . This is just an example of 7 inch display application. You need to adjust project “Include Search Pass” according to actual pass of your project.
Do not try to use it directly as an interface to N2PK VNA since some VNA control files are not included.
My next project is to develop a USB communications between the VNA and the interface.
Evgeny Lavrentiev, VE3SSR Evgeny@lecont.net