AN_258. FT800 Chinese Font Demo Application. Design Note

Similar documents
Application Note AN_385. FTDI D3XX Driver Installation Guide

Technical Note TN_152. USB 3.0 Compatibility Issues Explained

Application Note AN_243. FT312D USB Host to UART Cable Application

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

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

Application Note AN_299. FT800_FT801_Internal_Clock _Trimming

Application Note AN_242

Application Note AN_241. FTDI_AOA_HyperTerm_User_Manual

Technical Note TN_158. What is the Camera Parallel Interface?

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

Technical Note. TN_134 FTDI Android D2XX Driver

Application Note. AN_136_Hi-Speed Mini Module EEPROM Disaster Recovery

Determining USB Peripheral Device Class

Technical Note TN_146. Creating Android Images for Application Development

White Paper WP_001. Connecting Peripherals to an Android Platform

UMFT4222PROG FT4222 Programmer Module

Application Note AN_276. FT800 Audio File Conversion

Application Note AN_209. AN_209 PDIUSBD12 to FT120 Migration Guide

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

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

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

Application Note AN_254. FT800 Designs With Visual TFT

Future Technology Devices International Ltd

Future Technology Devices International Ltd

Technical Note. TN_147 Java D2xx for Android

Command Processor for MPSSE and MCU Host Bus Emulation Modes

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

White Paper WP_003. Android Peripheral Options

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

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

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

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

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

Future Technology Devices International Ltd. USB-Key. Datasheet

Simplified Description of USB Device Enumeration

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

USB Hi-Speed Serial/Hub Module. Datasheet

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

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

VDIP1. Vinculum VNC1L Module. Datasheet

Application Note AN_208. FT311D and FT312D Demo_APK_User_GuideFT311D and FT312D Demo_APK_User_Guide

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

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

Future Technology Devices International Ltd. Technical Note TN_101

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

Application Note AN_250. Configuring FT313H Driver for Embedded Linux

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

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

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

Application Note AN_252. FT800 Audio Primer

Future Technology Devices International Ltd. Windows XP Installation Guide

Vinco Development Module. Datasheet

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

Future Technology Devices International Ltd. Windows 2000 Installation Guide

Future Technology Devices International Ltd

Application Note AN_240. FT800 From the Ground Up

Application Note AN_146. USB Hardware Design Guidelines for FTDI ICs

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

USB-COM422-PLUS1. Datasheet

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

USB-COM422-PLUS2. Datasheet

Technical Note TN_105

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

USB-COM232-PLUS4. Datasheet

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

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

Application Note AN_113. Interfacing FT2232H Hi-Speed Devices To I2C Bus

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

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

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

Application Note: AN00141 xcore-xa - Application Development

SMARTCARD XPRO. Preface. SMART ARM-based Microcontrollers USER GUIDE

How To Use An Atmel Atmel Avr32848 Demo For Android (32Bit) With A Microcontroller (32B) And An Android Accessory (32D) On A Microcontroller (32Gb) On An Android Phone Or

Application Note AN_180. FT232H MPSSE Example - USB Current Meter using the SPI Interface

Future Technology Devices International Ltd. FT311D

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

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate With the Eagle System

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

Keep it Simple Timing

AN10811 Programming SPI flash on EA3131 boards Rev May 2009 Application note Document information Info Content Keywords Abstract

#include <Gamer.h> Gamer gamer; void setup() { gamer.begin(); } void loop() {

QT1 Xplained Pro. Preface. Atmel QTouch USER GUIDE

Synergy Controller Application Note 4 March 2012, Revision F Tidal Engineering Corporation Synergy Controller Bar Code Reader Applications

Short Manual Intellect v SP2 module Unipos Contents:

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

WA Manager Alarming System Management Software Windows 98, NT, XP, 2000 User Guide

RPLIDAR. Low Cost 360 degree 2D Laser Scanner (LIDAR) System Development Kit User Manual Rev.1

Lab 1: Introduction to Xilinx ISE Tutorial

SIM900_Custom Application Building Tutorial_Application Note_V1.00

Current Cost Data Cable User Guide. Installing and configuring the data cable

Android, Bluetooth and MIAC

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

Features Reference. About Unified Communication System. Before Using This Machine. Starting a Meeting. What You Can Do During the Meeting

ICs. Modules. Cables. FTDI Chip USB Solutions BRIDGING TECHNOLOGIES.

AN220 USB DRIVER CUSTOMIZATION

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

UM1676 User manual. Getting started with.net Micro Framework on the STM32F429 Discovery kit. Introduction

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

SM1231 USER GUIDE SM1231 RF MODULE USER GUIDE

DigiFox Professional Instruction Manual

Transcription:

AN_258 FT800 Chinese Font Demo Application Design Note Document Reference No.:FT_000896 Issue Date: 2014-06-09 This document is to introduce the design flow and note of FT800 Chinese Font Demo Application. It will give the audience the overall picture of the software. 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 E-Mail (Support): support1@ftdichip.com Web: http://www.ftdichip.com Copyright 2014Future Technology Devices International Limited

1 Table of Contents 2 Introduction... 3 2.1 Audience... 3 2.2 Scope... 3 2.3 Overview... 3 2.3.1 Hardware... 3 2.3.2 Application flow... 4 2.3.3 Architecture... 4 2.4 Hardware requirement... 5 2.5 Software requirement... 5 2.5.1 Software package introduction... 5 3 Application design note... 7 3.1 Bitmap data information... 8 3.2 Character code and bitmap handle... 9 4 Tag layout... 9 5 Generate the bitmap data and metrics block... 10 6 Contact Information... 12 7 Appendix A References... 13 7.1 Document References... 13 7.2 Acronyms and Abbreviations... 13 8 Appendix B List of Tables & Figures... 14 9 Appendix C Revision History... 15 2

2 Introduction FT800 combines display, audio and touch functionality into one single chip, powered by advanced FTDI Chip s EVE technology (Embedded Video Engine). The FT800 device interfaces with a system MCU via either SPI or I 2 C interface. To help customers easily make Chinese UI with the feature of FT800, a sample application is provided here for tutorial purposes. In this application, FT800 custom font is created for Chinese UI and applied on widgets, such as toggle, keys, buttons as well as texts. Note that the code relating to the creation of the screen shots could be reused in different MCU design environments. To learn more about Arduino platform and its IDE, please check http://www.arduino.cc 2.1 Audience This document assumes the audience has read the datasheet and programmer guide of the FT800. In addition, familiarity of the C/C++programming language is necessary to understand the sample application source code. Since the SPI interface is the main interface of FT800, the knowledge of SPI interface is also preferred. 2.2 Scope The Chinese Font Demo Application mentioned in this document is created with Arduino Pro IDE and Microsoft Windows Visual Studio. It is able to run on VM800P or Windows PC. 2.3 Overview 2.3.1 Hardware The diagram below gives the basic hardware setup. TFT Display VM800P / Windows PC FT800 Touch Panel Speaker Figure 1 Block Diagram of Setup 3

2.3.2 Application flow The diagram below gives the basic flow and structure to configuring the FT800 in an application. CONFIGURE THE SPI MASTER (MODE 0 MSB) INITIALISE THE FT800 READ DUMMY DATA AT ADDRESS 0 RESET THE FT800 CORE WRITE 0x68, 0x00 SET THE CLOCK WRITE 0x44, 0x00 INITIALISE THE TFT DISPLAY CONFIGURE VSYNC CONFIGURE HSYNC LOAD DUMMY DISPLAY LIST (e.g. blank screen) ENABLE PCLK CONFIGURE THE TFT TOUCH SENSE CONFIGURE THE AUDIO VOLUME CREATE DISPLAY LIST UPDATE (SWAP) DISPLAY LIST Figure 2 Application Flow 2.3.3 Architecture The application is designed to easily port to various platforms with SPI host functionality. Therefore, the application introduces one generic HAL (hardware abstraction layer) which can be used as a guideline for other platforms. 4

FT800 Demo Application Application HAL FT800 Figure 3 Architecture Diagram 2.4 Hardware requirement Option A: VM800B or VM800C development kit. Note that this kit comes with an option for 3 different size displays, 3.5, 4.3, or 5.0 (VM800B35A-D, VM800C35A-D, VM800B35A-D, VM800C43A-D, VM800B50A-D, VM800C50A-D, respectively). One FTDI MPSSE cable for USB to SPI bridge or VA800A-SPI board. Windows PC Option B: VM800P development kit. One USB cable with MicroB connector to provide power to the VM800P board and download binary into VM800P. Windows PC 2.5 Software requirement D2XX driver for FTDI MPSSE cable. Please download and install on the PC. Arduino IDE 1.0.5 FT800 Chinese Font Demo Application release package. 2.5.1 Software package introduction Bin folder contains the library and run time executables for Windows platform. Docs folder contains the application note of this application. 5

Hdr folder contains the header file of windows MSVC project. Src folder contains the source code of windows MSVC project. Test folder contains the font file used by application when running up. Project folder contains both the project files for Windows and Arduino platform. 6

3 Application design note This application implements one notepad with simple Chinese Input method enabled. It enables users to input the simplified or traditional Chinese font with SimFang ( 仿 宋 ) style. All the bitmap information used in this application for Chinese UI are extracted from simfang.ttf, which is part of windows 7 installation. You can find it from $(WindowsInstallPaths)\windows\fonts\. When users touches any letter from A to Z, the application gives 10 characters candidates for users to select. Users can choose any characters and constructs one note with up to 10 rows, 16 characters per row including space. After users complete the editing, users can view all the characters in a scrolling window. Figure 4 Main UI of Application 7

3.1 Bitmap data information Figure 5 Preview interface Out of A to Z, every key maps to 10 Chinese characters. All the fonts is in L4 format. The font style is SimFang ( 仿 宋 ). The following table describes the bitmap data information in details. Table 1 Bitmap data information used in font application Input File CELL Handl e A- F_ChineseS.tx t/ A- F_ChineseT.tx t G- L_ChineseS.tx t/ G- L_ChineseT.tx t M- R_ChineseS.t xt/m- R_ChineseT.t xt S- X_ChineseS.t xt/s- X_ChineseT.t xt Y- Z_ChineseS.t Address in RAM_G 1~60 1 0 (RAM_G) Bitmap Source Raw file size in byte -328 2870 8 1~60 2 28708 28380 2870 8 1~60 3 57416 57088 2870 8 1~60 4 86124 85796 2870 8 1~28 5 114832 114504 1347 6 Format & Style L4 format Stride 14 width 28 Height 34 L4 format Stride 14 width 28 Height 34 L4 format Stride 14 width 28 Height 34 L4 format Stride 14 width 28 Height 34 L4 format Stride 14 Description 60 characters whose pinyin begins with from A to F 60 characters whose pinyin begins with from G to L 60 characters whose pinyin begins with from M to R 60 characters whose pinyin begins with from S to X 20 characters whose pinyin 8

xt/y- Z_ChineseT.t xt width 28 Height 34 SC_Note.txt 1~12 6 128308 127946 6268 L4 format Stride 15 width 30 Height 34 3.2 Character code and bitmap handle begins with from Y to Z 8 characters for buttons 12 characters consists of space, cursor etc. The character code is invented to store the code of each character and there is one notepad buffer storing character code: (Max Row: 10, Max Col: 16) in the application. Every character code is 2 byte valid and range from 1 to 270. Application translates the tag value of touching character into character code by following formula and storing it into notepad buffer: Given Handle and Cell, calculate the character code by: Character code = (Handle-1) * 60 + CELL when Handle falls in 1 to 5. Character code between 1 to 268 Character code = 60*4 + 28 + CELL when Handle is 6. Character code between 269 to 280 When displaying all the characters stored in notepad buffer, i.e., all the characters selected by users, the character code has to be converted back into handle and cell number by following formula: Given Character code, calculate the handle and cell by: If Character code between 269 to 280, Handle = 6 Cell = character code 268 If Character code between 1 to 268, Handle = character code / 60 + 1 Cell = character code % 60 if (character code % 60) is not zero Handle = character code / 60 Cell = 60 if (character code % 60) is zero 4 Tag layout In main interface, tag feature of FT800 is utilized to detect user s touch. The table below shows the tag value layout in main interface. Table 2 Tag layout table at the main interface UI element Tag value Description Cmd_keys Cmd_keys 65-90 QWERTYUIOP ASDFGHJKL 9

Cmd_keys ZXCVBNM Cmd_keys 1 60 Candidate characters Cmd_button 251 Backspace Cmd_button 252 Space Cmd_button 253 Enter Cmd_button 254 Input Done(Finish editing) Cmd_toggle 250 Traditional/Simpified chinese toggle 5 Generate the bitmap data and metrics block There is one font conversion utility from FTDI to export the bitmap information from windows true type font file and form metrics blocks as FT800 specified. Users can easily run the following commands and find the output data at the output folder. For example, for command line 1, the output data is in file simfang_a- F_ChineseS.txt30\L4\simfang.ttf_30_L4.raw. Its format is in file simfang_a- F_ChineseS.txt30\L4\simfang.ttf_30_L4.rawh. About the fnt_cvt details, please refer to its release package. To generate for Simplified Chinese: 1. fnt_cvt.exe -i simfang.ttf -s 30 -u A-F_ChineseS.txt -d 0 2. fnt_cvt.exe -i simfang.ttf -s 30 -u G-L_ChineseS.txt -d 28708 3. fnt_cvt.exe -i simfang.ttf -s 30 -u M-R_ChineseS.txt -d 57416 4. fnt_cvt.exe -i simfang.ttf -s 30 -u S-X_ChineseS.txt -d 86124 5. fnt_cvt.exe -i simfang.ttf -s 30 -u Y-Z_ChineseS.txt -d 114832 6. fnt_cvt.exe -i simfang.ttf -s 30 -u SC_Note.txt -d 128308 To generate for traditional Chinese: 1. fnt_cvt.exe -i simfang.ttf -s 30 -u A-F_ChineseT.txt -d 0 2. fnt_cvt.exe -i simfang.ttf -s 30 -u G-L_ChineseT.txt -d 28708 3. fnt_cvt.exe -i simfang.ttf -s 30 -u M-R_ChineseT.txt -d 57416 4. fnt_cvt.exe -i simfang.ttf -s 30 -u S-X_ChineseT.txt -d 86124 5. fnt_cvt.exe -i simfang.ttf -s 30 -u Y-Z_ChineseT.txt -d 114832 6. fnt_cvt.exe -i simfang.ttf -s 30 -u SC_Note.txt -d 128308 The resource used in both scenario*: SC_Note.txt Simplified Chinese input file*: Y-Z_ChineseS.txt S-X_ChineseS.txt M-R_ChineseS.txt A-F_ChineseS.txt G-L_ChineseS.txt Traditional Chinese input file*: 10

Y-Z_ChineseT.txt S-X_ChineseT.txt M-R_ChineseT.txt G-L_ChineseT.txt A-F_ChineseT.txt *All files are available for download in the EVE Software example FT_Chinese Font, available here: http://www.ftdichip.com/support/softwareexamples/ft800_projects.htm 11

6 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 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) sales1@ftdichip.com support1@ftdichip.com admin1@ftdichip.com 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 http://www.ftdichip.com Distributor and Sales Representatives Please visit the Sales Network page of the FTDI Web site for the contact details of our distributor(s) and sales representative(s) in your country. 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 12

7 Appendix A References 7.1 Document References 1. datasheet for VM800C 2. datasheet for VM800B 3. datasheet for VM800P 4. FT800 programmer guide FT_000793 5. FT800 Embedded Video Engine Datasheet FT_000792 7.2 Acronyms and Abbreviations Terms Description Arduino Pro The open source platform variety based on ATMEL s ATMEGA chipset EVE Embedded Video Engine SPI Serial Peripheral Interface UI User Interface USB Universal Serial Bus 13

8 Appendix B List of Tables & Figures Figure 1 Block Diagram of Setup... 3 Figure 2 Application Flow... 4 Figure 3 Architecture Diagram... 5 Figure 4 Main UI of Application... 7 Figure 5 Preview interface... 8 Table 1 Bitmap data information used in font application... 8 Table 2 Tag layout table at the main interface... 9 14

9 Appendix C Revision History Document Title: Document Reference No: AN_258_FT800_APP_Font_Design_Note FT_000896 Clearance No: FTDI# 388 Product Page: Document Feedback: http://www.ftdichip.com/products/ics/ft800.html Send Feedback Revision Changes Date 0.1 Initial draft release 2013-03-06 1.0 Initial release 2014-09-06 15