Application Note AN_254. FT800 Designs With Visual TFT



Similar documents
Application Note AN_385. FTDI D3XX Driver Installation Guide

Application Note AN_299. FT800_FT801_Internal_Clock _Trimming

Technical Note TN_158. What is the Camera Parallel Interface?

Technical Note TN_152. USB 3.0 Compatibility Issues Explained

Application Note AN_242

Application Note AN_241. FTDI_AOA_HyperTerm_User_Manual

Application Note AN_243. FT312D USB Host to UART Cable Application

Application Note AN_209. AN_209 PDIUSBD12 to FT120 Migration Guide

Future Technology Devices International Ltd. FTDI Drivers Installation guide for. Windows 7

Determining USB Peripheral Device Class

White Paper WP_001. Connecting Peripherals to an Android Platform

Application Note. AN_136_Hi-Speed Mini Module EEPROM Disaster Recovery

UMFT4222PROG FT4222 Programmer Module

Application Note AN_101. Submitting Modified FTDI Drivers for Windows Hardware Certification

FTDI Chip. VM800P Datasheet Embedded Video Engine Plus Module. VM800P Embedded Video Engine Plus Module Datasheet Version 1.0

Technical Note. TN_134 FTDI Android D2XX Driver

Application Note AN_276. FT800 Audio File Conversion

Future Technology Devices International Ltd. Application Note AN_234. FTDI Drivers Installation guide for. Windows 8

Technical Note TN_146. Creating Android Images for Application Development

Future Technology Devices International Ltd

Application Note AN_185. Vinculum-II UART to USB HID Class Host Bridge

Application Note AN_240. FT800 From the Ground Up

Future Technology Devices International Ltd

Application Note AN_149. Upgrading a passive DB9 RS232 Interface to an active USB Interface using an FTDI DB9-USB-RS232 Module

Command Processor for MPSSE and MCU Host Bus Emulation Modes

Future Technology Devices International Ltd. FTDI Drivers Installation guide for Windows XP

VF2F. USB Flash Disk File-to-file Transfer Vinculum Evaluation Kit. Future Technology Devices International Ltd. Preliminary - Subject to Change

Future Technology Devices International Ltd. USB NMC-2.5m. USB to USB Null Modem Cable. Datasheet

C232HD. USB 2.0 Hi-Speed to UART Cable. Datasheet

FT2232H Mini Module. USB Hi-Speed FT2232H Evaluation Module. Datasheet

FT4232H Mini Module. USB Hi-Speed FT4232H Evaluation Module. Datasheet

VDIP1. Vinculum VNC1L Module. Datasheet

TTL-232R. TTL to USB Serial Converter Range of Cables. Datasheet

TTL-232R-PCB. TTL to USB Serial Converter PCB. Datasheet

Technical Note. TN_132 Adding FTDI Devices VCP Driver Support to Android

Simplified Description of USB Device Enumeration

Application Note AN_208. FT311D and FT312D Demo_APK_User_GuideFT311D and FT312D Demo_APK_User_Guide

Future Technology Devices International Ltd. USB-Key. Datasheet

C232HM. USB 2.0 Hi-Speed to MPSSE Cable. Datasheet

USB Hi-Speed Serial/Hub Module. Datasheet

Future Technology Devices International Ltd. VF2F2. USB Flash Disk File-to-file Transfer Vinculum Evaluation Kit.

Technical Note. TN_147 Java D2xx for Android

Application Note AN_252. FT800 Audio Primer

Vinco Development Module. Datasheet

Future Technology Devices International Ltd. AN232R-02 FTDIChip-ID for the FT232R and FT245R

Future Technology Devices International Ltd. USB to RS232 UART Serial Converter PCB. Datasheet

Future Technology Devices International Ltd USB TO RS422 UART SERIAL CONVERTER PCB. Datasheet. Document Reference No.: FT_000119

Application Note AN_250. Configuring FT313H Driver for Embedded Linux

Future Technology Devices International Ltd. FTDI Drivers Installation guide for. Windows VISTA

Future Technology Devices International Ltd

Future Technology Devices International Ltd. Technical Note TN_101

Future Technology Devices International Ltd. FTDI Drivers Installation guide for Windows XP

Application Note AN_146. USB Hardware Design Guidelines for FTDI ICs

TTL-232R-3V3 USB to TTL Serial Converter Cable

Future Technology Devices International Ltd. Windows XP Installation Guide

Future Technology Devices International Ltd. USB to RS232 Serial Converter Range of Cables. Datasheet

DATASHEET. ADAM Arduino Display Adaptor Module. Arduino Compatible Shield P/N: 4Display-Shield-FT843 For the 4D Systems 4DLCD-FT843 Display

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

The DB9-USB Family of. UART Converter Modules. Datasheet

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

USB-COM422-PLUS1. Datasheet

TTL-232R. TTL to USB Serial Converter Range of Cables. Datasheet

3. Programming the STM32F4-Discovery

Future Technology Devices International Ltd. FT311D

USB-COM422-PLUS2. Datasheet

DB9-USB-RS232 Module. Male & Female. Datasheet

Embedded Systems Design Course Applying the mbed microcontroller

Application Note: AN00141 xcore-xa - Application Development

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

3.2 inch QVGA TFT Color LCD User s Guide Version 1 & 2

USB-COM232-PLUS4. Datasheet

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

Technical Note TN_105

FTDI Chip Microcontrollers BRIDGING TECHNOLOGIES

Product Brief. 2.0 microtoled. Intelligent GOLDELOX Display Module. µtoled-20-g2. Rev 1.0

Lab Experiment 1: The LPC 2148 Education Board

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

Software User Guide UG-461

Implementing SPI Communication Between MSP430 G2452 and LTC ADC

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

FTDI Ltd DS_US232R-10(R-100/500) USB to RS232 Adapter cable. Data Sheet

Creating a Project with PSoC Designer

Figure 1. 8-Bit USB Debug Adapter

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

D-MAX WEB GUIDE CONTROLLER WITH OPERATOR INTERFACE PANEL QUICK START SETUP MANUAL

Introduction to graphics and LCD technologies. NXP Product Line Microcontrollers Business Line Standard ICs

How To Develop A Toolstick

GPS/GLONASS SiRFstarV Evaluation Kit EVA5100-A

Application Note AN_100. Using the FT232R/FT245R with an External Crystal or Oscillator

AN3265 Application note

USER GUIDE EDBG. Description

SBC8600B Single Board Computer

An Introduction to MPLAB Integrated Development Environment

Transcription:

AN_254 FT800 Designs With Visual TFT Issue Date: 2013-09-30 The FTDI FT800 video controller offers a low cost solution for embedded graphics requirements. In addition to the graphics, resistive touch inputs and an audio output provide a complete human machine interface to the outside world. This application note will describe the process of developing MCU code with MikroElektronika tools to control the FT800. Use of FTDI devices in life support and/or safety applications is entirely at the user s risk, and the user agrees to defend, indemnify and hold FTDI harmless from any and all damages, claims, suits or expense resulting from such use. Future Technology Devices International Limited (FTDI) Unit 1, 2 Seaward Place, Glasgow G41 1HH, United Kingdom Tel.: +44 (0) 141 429 2777 Fax: + 44 (0) 141 429 2758 Web Site: http://ftdichip.com

Table of Contents 1 Introduction... 2 2 VisualTFT FT800 Support... 3 3 Hardware Connection... 4 4 Visual TFT Project... 5 4.1 Creating the project... 5 4.2 Project Settings... 5 4.3 Placing Objects... 7 4.4 Object Properties... 7 4.5 Generating Code... 8 4.6 User Code... 8 5 Code Compiler... 2 6 Code Loading onto the Microcontroller... 3 7 FT800 Design Summary... 4 8 MikroElektronika... 5 9 Contact Information... 6 Appendix A References... 7 Document References... 7 Acronyms and Abbreviations... 7 Appendix B List of Tables & Figures... 8 List of Figures... 8 Appendix C Revision History... 9 1

1 Introduction The FT800 is a peripheral to the main system processor dedicated to rendering graphics, sensing display touch stimulus, and playing audio. The device is controlled over a low bandwidth SPI or I 2 C interface allowing interfacing to nearly any microcontroller with a SPI or I 2 C master port. Simple and low-pin-count microcontrollers can now have a high-end graphical user interface by using the FT800. After selecting the system microcontroller to be used in a design it is important to have the correct tools to develop the firmware running on the microcontroller. One option is to use compilers from MikroElectronika if your chosen microcontroller is on the list of supported devices. A key benefit in doing this, is that MikroElectronika also provide a graphical interface tool, Visual TFT, that integrates to their compilers. This application note will demonstrate how the graphical interface of Visual TFT allows users to rapidly develop a display solution by dragging and dropping objects onto the design palette. The majority of actual code is then created with the MikroElectronika libraries at the push of a button to complete the design. 2

2 VisualTFT FT800 Support At the time of writing, Visual TFT has FT800 library support for the following processor families: Stellaris ARM, STM32 ARM, PIC32, ATMEGA. It is recommended to check with MikroElectronika if a specific device is supported. This example will use the STM32F207VG processor. 3

3 Hardware Connection SYSTEM MICROCONTROLLER FT800 TFT PANEL SPI MASTER BUS SS# SCLK MOSI MISO SPI SLAVE BUS RED(7:2) GREEN(7:2) BLUE(7:2) DE GPIO PD# DISP PCLK VSYNC HSYNC Figure 3.1 Interconnection Diagram NOTE: The code being developed is running on the system microcontroller. The FT800 does not require code compiled for it. It is simply an SPI peripheral to the system microcontroller. 4

4 Visual TFT Project 4.1 Creating the project VisualTFT has a ribbon bar similar to many Microsoft applications. Selecting Project > New will display a pop up where the project name is created and saved. Figure 4.1 New Project Providing a project name and selecting OK will open the Project Settings window. 4.2 Project Settings Figure 4.2 Project Settings The first pull down box (Hardware Patterns) on this screen allows the user to select the processor the application code should target. The second pull down box (Target Compiler) allows the user to select the compiler that will be used to generate the executable binary code from the object placement performed in Visual TFT. The advanced settings arrow expands to a form that allows the user to create processor specific settings such as clock speed, and initialization of the interface for the SPI/I2C component of the microcontroller. The example given shows a clock speed of 12MHz with an FT800 display controller connecting to a 480 x 272 display. Figure 4.3 General Settings 5

The TFT tab provides a menu for setting basic display parameters. The parameters are defined from the display datasheet. Polarity and Clock Spread are features the FT800 supports. The polarity setting refers to data latching on the pixel clock while clock spread determines if all RGB signals change at the same time or are staggered on subsequent clock edges to improve noise immunity. The RST and CS settings define the MCU pins that will drive the FT800 SPI chip select input and reset pins. Figure 4.4 TFT Settings The Touch Panel tab allows the values for the FT800 touch registers to be set. Actual values will be determined from the display datasheet. For displays without touch capability the values are still written, but have no functional meaning. Figure 4.5 Touch Panel Settings Resource settings are specific to the microcontroller and define whether internal or external memory is used. Figure 4.6 Resource Settings When all the settings are made the user can chose to save the configuration as their own template or simply select OK with the defaults. It is recommended if making edits that the settings are saved with a unique name. 6

4.3 Placing Objects Objects to be displayed are dragged from the component palette onto the main window which represents the display as it will be seen in the final project. Note the palette contains simple shapes such as lines, boxes and circles as well as complex FT800 specific widgets for creating complex objects such as a clock, gauge and slider bars, rapidly. Figure 4.7 Component Palette Figure 4.8 Objects Placement Multiple screens are also possible by pressing the icon. This allows for a button press or a touch screen event to load a second screen and display new information. 4.4 Object Properties The properties of an object such as colour, size and location may be configured in the component property table. This allows for configuration to happen without writing any code. For complex objects, such as the clock widget, additional settings such as the time may be set via this property table also. Figure 4.9 Object Properties 7

4.5 Generating Code After placing the objects on the main window the next step is to generate code that the compiler will use to generate the executable binary. With Visual TFT this is achieved with a simple button press from the ribbon bar. The icon will generate the code and allow you to view the generated code. At this stage the project contains enough information to build an output file that will configure the microcontroller SPI port and draw a static display. To make use of the touch features or create animations will require the user to write code. 4.6 User Code User code allows buttons to perform functions or clocks to tick. The first step is to create the event in the component property window. This is the label for the actual event. In the user code window to make the button switch from the current screen to screen2, the code would look like: void EveButton1OnClick() { {DrawScreen(&Screen2);} Figure 4.10 Object Properties For tasks such as making the clock tick, code such as: void Clock() { Delay_ms(1000); if (EveClock1.sec <= 59) {EveClock1.sec = (EveClock1.sec + 1); DrawScreen(&Screen2); } else {EveClock1.sec = 0; DrawScreen(&Screen2); if (EveClock1.min <= 59) {EveClock1.min = (EveClock1.min + 1); DrawScreen(&Screen2); } else {EveClock1.min = (EveClock1.min = 0); DrawScreen(&Screen2); if (EveClock1.hour <= 11) {EveClock1.hour = (EveClock1.hour + 1); DrawScreen(&Screen2); } else {EveClock1.hour = (EveClock1.hour = 0); DrawScreen(&Screen2); } } 8

} } is used. Note the format for selecting the clock parameters: EveClock1 is the object..min is the minute parameter The value for a minute is between 0 and 59. More information on MikroElectonica syntax is available from MikroElectronika or via the tool online help. This code is then sent with the full project to the compiler. To send the code to the compiler use the icon in the ribbon toolbar. 1

5 Code Compiler The files from Visual TFT are sent to the MikroElectronika compiler. This will auto generate a project and pull in the code created by visual TFT. This code will all be based around MikroElectronika libraries. However the events_code file will match the text input user code in Visual TFT. This code may be edited in the compiler or the visual TFT tool as the projects are now interlinked. From the Build option in the toolbar select Rebuild all sources to generate the HEX file that will be loaded into the processor. The tool also contains a messages window such that any errors in the code may be found. These errors should hopefully be confined to the events_code file and not the auto generated sections. 2

6 Code Loading onto the Microcontroller Loading the compiled file from the PC to the target microcontroller may depend on the microcontroller chosen. Some devices allow for programming over UART, USB or JTAG. At FTDI we use the mikroprog tool from MikroElectronika. This is integrated into the MikroElectronika tool suite and allows for rapid programming and debug. Figure 6.1 mikroprog 3

7 FT800 Design Summary The FT800 provides an easy way to incorporate graphics displays into products providing for a lower cost solution or enabling a display into systems that could not otherwise afford this capability. With only the FT800 between the MCU and the LCD display, a vivid graphics experience with touch and audio is now possible. The overall design flow regardless of the toolset chosen, from component selection to displaying the first screen is captured here: Hardware Select MCU SPI or I2C GPIO for PD_n Interrupt Input Select Display, Audio & Touch Size = WQVGA, QVGA, up to 512 x 512 Resistive Touch Audio Amplifier Software Configure MCU Interface SPI Mode Zero -or- I2C Address Set Host MCU SPI Speed to 10MHz maximum Little Endian Data Format Wake-up FT800 Toggle PD_n low for 20ms min., then high Write 0x00, 0x00, 0x00 to wake FT800 Write 0x44, 0x00, 0x00 to select Ext Clock Write 0x62, 0x00, 0x00 to select 48MHz Host MCU SPI Speed can now go up to 30MHz REG_PCLK = zero until after display parameters are set Configure Display Set Screen Registers Vertical REG_VCYCLE, REG_VSIZE, REG_VSYNC0/1, REG_VOFFSET Horizontal REG_HCYCLE, REG_HSIZE, REG_HSYNC0/1, REG_HOFFSET Configure Touch and Audio Set Touch Registers REG_TOUCH_MODE, REG_TOUCH_RZTHRESH, Others if necessary Set Audio Register REG_VOL_SOUND = zero Write Initial Display List & Enable Display Write Application Display List Swap Display LIsts CLEAR_COLOUR_RGB(0,0,0) CLEAR(1,1,1) DISPLAY SWAP_LIST REG_PWM_DUTY brightness, PWM_HZ, frequency REG_GPIO bit 7 = 1 DISP REG_PCLK = LCD dot/pixel clock frequency CLEAR_COLOUR_RGB(0,0,0) CLEAR(1,1,1) ** APPLICATION DATA ** DISPLAY SWAP_LIST Figure 7.1 FT800 Hardware and Software Design Flow 4

8 MikroElektronika MikroElektronika have been developing world class tool chains for microcontroller application development for over a decade. To find out more about MikroElektronika and more importantly the FT800 support they provide, visit their website at www.miikroe.com 5

9 Contact Information Head Office Glasgow, UK Future Technology Devices International Limited Unit 1, 2 Seaward Place, Centurion Business Park Glasgow G41 1HH United Kingdom Tel: +44 (0) 141 429 2777 Fax: +44 (0) 141 429 2758 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) sales1@ftdichip.com support1@ftdichip.com admin1@ftdichip.com Branch Office Tigard, Oregon, USA Future Technology Devices International Limited (USA) 7130 SW Fir Loop Tigard, OR 97223-8160 USA Tel: +1 (503) 547 0988 Fax: +1 (503) 547 0987 E-Mail (Sales) E-Mail (Support) E-Mail (General Enquiries) us.sales@ftdichip.com us.support@ftdichip.com us.admin@ftdichip.com Branch Office Taipei, Taiwan Future Technology Devices International Limited (Taiwan) 2F, No. 516, Sec. 1, NeiHu Road Taipei 114 Taiwan, R.O.C. Tel: +886 (0) 2 8791 3570 Fax: +886 (0) 2 8791 3576 Branch Office Shanghai, China Future Technology Devices International Limited (China) Room 1103, No. 666 West Huaihai Road, Shanghai, 200052 China Tel: +86 21 62351596 Fax: +86 21 62351595 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) tw.sales1@ftdichip.com tw.support1@ftdichip.com tw.admin1@ftdichip.com E-mail (Sales) E-mail (Support) E-mail (General Enquiries) cn.sales@ftdichip.com cn.support@ftdichip.com cn.admin@ftdichip.com Web Site www.ftdichip.com System and equipment manufacturers and designers are responsible to ensure that their systems, and any Future Technology Devices International Ltd (FTDI) devices incorporated in their systems, meet all applicable safety, regulatory and system-level performance requirements. All application-related information in this document (including application descriptions, suggested FTDI devices and other materials) is provided for reference only. While FTDI has taken care to assure it is accurate, this information is subject to customer confirmation, and FTDI disclaims all liability for system designs and for any applications assistance provided by FTDI. Use of FTDI devices in life support and/or safety applications is entirely at the user s risk, and the user agrees to defend, indemnify and hold harmless FTDI from any and all damages, claims, suits or expense resulting from such use. This document is subject to change without notice. No freedom to use patents or other intellectual property rights is implied by the publication of this document. Neither the whole nor any part of the information contained in, or the product described in this document, may be adapted or reproduced in any material or electronic form without the prior written consent of the copyright holder. Future Technology Devices International Ltd, Unit 1, 2 Seaward Place, Centurion Business Park, Glasgow G41 1HH, United Kingdom. Scotland Registered Company Number: SC136640 6

Appendix A References Document References DS_FT800 FT800 Datasheet PG_FT800 FT800 Programmer Guide AN_240 FT800 From the Ground Up MikroElectronika (www.mikroe.com) Acronyms and Abbreviations Terms EVE GPIO I 2 C IC MCU QVGA SPI TFT VGA WQVGA Description Embedded Video Engine General Purpose Input / Output Inter-Integrated Circuit Integrated Circuit Microcontroller Quarter VGA (320 x 240 pixel display size) Serial Peripheral Interface Thin-Film Transistor Video Graphics Array Wide Quarter VGA (480 x 272 pixel display size) 7

Appendix B List of Tables & Figures List of Figures Figure 3.1 Interconnection Diagram... 4 Figure 4.1 New Project... 5 Figure 4.2 Project Settings... 5 Figure 4.3 General Settings... 5 Figure 4.4 TFT Settings... 6 Figure 4.5 Touch Panel Settings... 6 Figure 4.6 Resource Settings... 6 Figure 4.7 Component Palette... 7 Figure 4.8 Objects Placement... 7 Figure 4.9 Object Properties... 7 Figure 4.10 Object Properties... 8 Figure 6.1 mikroprog... 3 Figure 7.1 FT800 Hardware and Software Design Flow... 4 8

Appendix C Revision History Document Title: Document Reference No.: FT_000880 Clearance No.: FTDI# 350 Product Page: http://www.ftdichip.com/eve.htm Document Feedback: Send Feedback Revision Changes Date 1.0 Initial Release 2013-09-30 9