Application Note AN_195. Vinculum-II UART to SPI Master Bridge

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

Determining USB Peripheral Device Class

Application Note AN_385. FTDI D3XX Driver Installation Guide

Application Note. AN_136_Hi-Speed Mini Module EEPROM Disaster Recovery

Technical Note TN_152. USB 3.0 Compatibility Issues Explained

White Paper WP_001. Connecting Peripherals to an Android Platform

Application Note AN_209. AN_209 PDIUSBD12 to FT120 Migration Guide

Application Note AN_243. FT312D USB Host to UART Cable Application

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

Application Note AN_241. FTDI_AOA_HyperTerm_User_Manual

Technical Note. TN_134 FTDI Android D2XX Driver

Future Technology Devices International Ltd

Future Technology Devices International Ltd

Application Note AN_242

VDIP1. Vinculum VNC1L Module. Datasheet

Application Note AN_299. FT800_FT801_Internal_Clock _Trimming

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

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

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

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

Vinco Development Module. Datasheet

Technical Note TN_158. What is the Camera Parallel Interface?

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

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

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

UMFT4222PROG FT4222 Programmer Module

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

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

Technical Note TN_146. Creating Android Images for Application Development

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

Application Note AN_276. FT800 Audio File Conversion

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

Future Technology Devices International Ltd. USB-Key. Datasheet

Simplified Description of USB Device Enumeration

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

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

White Paper WP_003. Android Peripheral Options

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

Command Processor for MPSSE and MCU Host Bus Emulation Modes

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

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

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

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

USB Hi-Speed Serial/Hub Module. Datasheet

Technical Note. TN_147 Java D2xx for Android

Application Note AN_254. FT800 Designs With Visual TFT

Future Technology Devices International Ltd

Application Note AN_208. FT311D and FT312D Demo_APK_User_GuideFT311D and FT312D Demo_APK_User_Guide

Future Technology Devices International Ltd. Technical Note TN_101

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

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

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

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

Future Technology Devices International Ltd. FT311D

USB-COM422-PLUS1. Datasheet

USB-COM422-PLUS2. Datasheet

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

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

Future Technology Devices International Ltd. Windows XP Installation Guide

USB-COM232-PLUS4. Datasheet

Future Technology Devices International Ltd. MM232R USB - Serial UART Development Module. Datasheet

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

Future Technology Devices International Ltd. Windows 2000 Installation Guide

Application Note AN_146. USB Hardware Design Guidelines for FTDI ICs

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

Future Technology Devices International Ltd. UM245R USB - Parallel FIFO. Development Module. Datasheet

Application Note AN_250. Configuring FT313H Driver for Embedded Linux

Technical Note TN_105

Application Note AN_252. FT800 Audio Primer

Data Transfer between Two USB Flash SCSI Disks using a Touch Screen

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

Future Technology Devices International Ltd. UM232R USB - Serial UART Development Module. Datasheet

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

UC232R ChiPi Minimum Component FT232RL USB to RS232 Converter Cable

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

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

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

Designing VM2 Application Boards

UM245R USB-Parallel FIFO Development Module

USB - FPGA MODULE (PRELIMINARY)

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

Future Technology Devices International Ltd. UM232H Single Channel USB Hi-Speed FT232H Development Module. Datasheet

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

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

Chapter 13. PIC Family Microcontroller

L16. Quectel GNSS Engine. EVB User Guide L16_EVB_UGD_V1.0

Using Xbee in Serial Communication

Wireless Temperature

Application Note AN_240. FT800 From the Ground Up

L10. Quectel GPS Engine. EVB User Guide L10_EVB_UGD_V1.00

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

Tutorial for MPLAB Starter Kit for PIC18F

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

SM1231 USER GUIDE SM1231 RF MODULE USER GUIDE

Lab Experiment 1: The LPC 2148 Education Board

udrive-usd-g1 Embedded DOS micro-drive Module Data Sheet

Future Technology Devices International Ltd. FT232BM USB UART IC

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Testing Data Radio Modem with Serial Port Tool V1.20

Transcription:

AN_195 Vinculum-II UART to SPI Master Bridge Issue Date: 2011-11-15 This application note forms part of a series of application notes detailing the new simplified ROM images for VNC2. It will detail the implementation and use of a VNC2 ROM file for bridging a UART interface to an SPI Slave device connected to a VNC2 SPI Master interface. 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. 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 1.1 VNC2 Devices... 2 2 Using the Sample Code... 3 3 Default Pin-out... 4 4 Building and Loading the Firmware into the VNC2... 6 4.1 Build... 6 4.2 Load... 6 4.3 Loading with FT_Prog... 7 5 Source Code for the VNC2 Application... 8 5.1 UART_SPIM.C... 8 5.1.1 main()... 8 5.1.2 iomux_setup()... 8 5.1.3 Open drivers/close drivers... 8 5.1.4 UARTSPIM... 9 5.1.5 SPIMUART... 9 6 Contact Information... 10 Appendix A References... 11 Document References... 11 Acronyms and Abbreviations... 11 Appendix B List of Tables & Figures... 12 List of Tables... 12 List of Figures... 12 Appendix C Revision History... 13 1

1 Introduction FTDI have introduced a new suite of simplified bridging ROM files to allow for fast interconnect between differing interfaces. These ROM images (and sample source code) are targeted at those users who would like to implement VNC2 into a design without creating their own firmware. As well as providing the source code for users wishing to modify setup parameters the default project is supplied as a precompiled ROM file ready for installation into the VNC2. This application note forms part of a series of application notes detailing the new simplified ROM images for VNC2. It will detail the implementation and use of a VNC2 ROM file for bridging a UART interface to an SPI Slave device connected to a VNC2 SPI Master interface. This particular project may be used in 32, 48 or 64 pin packages. For users not intending to edit the code in any way the precompiled code may be loaded over the UART interface with FT_PROG as an alternative to using the IDE. Links for the project file UART_SPIM.vproj and the precompiled ROM file UART_SPIM.rom file may be found at the end of the document in Appendix A. 1.1 VNC2 Devices VNC2 is the second of FTDI s Vinculum family of embedded dual USB host controller devices. The VNC2 device provides USB Host interfacing capability for a variety of different USB device classes including support for BOMS (bulk only mass storage), Printer and HID (human interface devices). For mass storage devices such as USB Flash drives, VNC2 transparently handles the FAT file structure. Communication with non USB devices, such as a low cost microcontroller, is accomplished via either UART, SPI or parallel FIFO interfaces. VNC2 provides a new, cost effective solution for providing USB Host capability into products that previously did not have the hardware resources available to do this. VNC2 allows designers to develop their own firmware using the Vinculum-II software development tool suite. These development tools provide compiler, assembler, linker and debugger tools complete within an integrated development environment (IDE). The Vinculum-II VNC2 family of devices are available in Pb-free (RoHS compliant) 32-lead LQFP, 32-lead QFN, 48-lead LQFP, 48-lead QFN, 64-Lead LQFP and 64-lead QFN packages For more information on the ICs refer to http://www.ftdichip.com/products/ics/vnc2.htm. 2

2 Using the Sample Code 3V3 1V8 UART DEVICE UART DATA VCCIO 3V3VREGIN RESET PROG# VNC2 VREGOUT 1V8 PLL IN SPI MASTER DATA SPI SLAVE DEVICE DEBUGGER I/F XTIN XTOUT TEST 12MHz GND Figure 2.1 Connecting the Demo When the VNC2 is programmed, the user simply passes data from the UART device to the VNC2. The VNC2 will process this data to pass it out to the SPI Slave device via the SPI Master interface. Similarly any data passed from the SPI Slave device via SPI Master interface to the VNC2 will be processed by the VNC2 and passed out the UART port to the UART device. There are no additional commands required it is a simple data bridge. The project default sets the UART to 9600-8-N-1 (RTS/CTS flow control). The project uses VNC2 SPI Master interface. The default interface sends data most significant bit first, with a clock speed of 50kHHz. The mode is SPI mode 0. 3

3 Default Pin-out The VNC2 can assign the same signal to a variety of pins. The default pins used for this ROM image are shown in Table 3.1: Signal 32-pin pkg 48-pin pkg 64-pin pkg Description GND 1, 16, 19, 27 1, 24, 27, 39 1, 30, 35, 53 Device ground supply pins 3V3 VREGIN 2 2 2 +3.3VDC supply to the regulator 1V8 VCC PLL IN 3 3 3 GND PLL 6 6 6 VREG OUT 7 7* 7 VCCIO 13, 22, 28 17, 30, 40 21, 38, 54 +1.8VDC supply to internal clock multiplier Requires 100nF decoupling capacitor close to pin Device analog ground supply for internal clock multiplier +1.8VDC output from regulator to device core *Not used on 48-pin LQFP package +3.3VDC supply to I/O interface pins (IOBUS) VCCIO must be connected for proper operation Input to 12MHz Oscillator XTIN 4 4 4 Connect 12MHz crystal across pins 4 and 5 with proper loading capacitance Output from 12MHz Oscillator XTOUT 5 5 5 TEST 8 8 8 RESET# 10 9 9 PROG# 9 10 10 Connect 12MHz crystal across pins 4 and 5 with proper loading capacitance Test Must be connected to GND for normal operation Can be used by an external device to reset VNC2 Asserting PROG# enables program mode DEBUGGER I/F 11 11 11 I/O for programming and in-circuit debugging spi_m_clk 29 20 61 SPI master clock input spi_m_mosi 12 21 62 Master Out Slave In Synchronous Data from master to slave 4

Signal 32-pin pkg 48-pin pkg 64-pin pkg Description spi_m_miso 14 22 63 spi_m_ss_0# 15 23 64 Master In Slave Out Synchronous Data from slave to master Active low slave select 0 from master to slave 0 UART RXD 24 32 40 UART data input to VNC2 UART TXD 23 31 39 UART data output from VNC2 UART RTS# 25 33 41 UART CTS# 26 34 42 UART RTS# output from VNC2 Logic 0 implies the VNC2 can accept more data UART CTS# input to VNC2 Logic 0 allows the VNC2 to send more data on UART TXD Table 3.1 VNC2 Pin-Out Designers wishing to customize the design should refer to the iomux.c file for changing pin-out options. 5

4 Building and Loading the Firmware into the VNC2 Everything can be controlled by the IDE. To access the application simply use the Project -> Open tab to browse to the UART_SPIM.vproj file for your project. Figure 4.1 Vinculum-II Project Open Button 4.1 Build This step is only necessary if you are not using the precompiled version of the ROM. Otherwise proceed to loading the ROM file. To build the application you simply press the Build button on the IDE ribbon bar under the build tab. Figure 4.2 Vinculum-II IDE Build Button 4.2 Load Loading the code is equally simple. Just click on the Flash button on the ribbon bar under the debug tab. The Flash button will automatically pick up the Rom file in your project but for reference the filename is UART_SPIM.rom. Figure 4.3 Vinculum-II IDE Flash Button Note the Debugger Interface is listed as V2EVAL Board C. It is important that this box shows a device is connected before attempting to flash a device. 6

4.3 Loading with FT_Prog If the precompiled ROM file meets all the requirements of the end design then the IDE and source code are not required. The precompiled UART_SPIM.rom file may be loaded into the VNC2 with FT_PROG over the UART interface. FT_Prog is used to program the VNC2 with a ROM file. FT_Prog is available from the FTDI website utilities page (version 1.12 or later supports VNC2). Select the flash ROM tab at the top of the window. Select VNC2 from the pull down tab. Select D2xx or VCP interface (either will work). Select the location where the ROM file resides. Press the program button. Perform a hard reset (power cycle) prior to running the firmware. Figure 4.4 is an example of programming the VNC2 Evaluation board revision 2 with the V2DAP firmware. Figure 4.4 FT_Prog Programming Utility For more information on loading ROM files onto a VNC2 device refer to: AN_159_Vinculum_II_Firmware_Flash_Programming.pdf 7

5 Source Code for the VNC2 Application This section is aimed at those wanting to learn about coding VNC2 devices or modifying the existing project. All VNC2 application firmware follows a similar format and most of the code can be written using the IDE application wizard. The basic steps are: 1. Initialise device drivers 2. Define pin-outs 3. Open ports to be used 4. Configure ports to be used 5. Read/write data 6. Close ports The VNC2 source code for this project can be viewed in appendix A and can also be downloaded free from the FTDI website. 5.1 UART_SPIM.C UART_SPIM.c is the main firmware file. This file is split into multiple functions. void main(); void iomux_setup(void); void open_drivers(void); void close_drivers(void); void UARTSPIM(); void SPIMUART(); 5.1.1 main() Main is the entry point for all VNC2 applications. It is used to definethe VNC2 core clock speed, loads the drivers to be used and creates the threads to be used in the application. At the very end of main is the call: vos_start_scheduler(); After this call there can be no further configuration of the device. 5.1.2 iomux_setup() iomux_setup calls a function in the file UART_SPIM_iomux.c within the project; this file is used to define the VNC2 pin-out. Most signals can be programmed to appear on different pins;notable exceptions are power, GND and the USB ports. 5.1.3 Open drivers/close drivers The open drivers function call will provide a handle to each hardware block used in the project and this handle can be used by subsequent commands to control the hardware. The close_drivers function is used to close handles to all open devices. 8

5.1.4 UARTSPIM 5.1.5 This function will configure the UART port 9600-8-N-1 (RTS/CTS flow control). The function will also read data from the UART port and write it out to the SPI Slave device via the SPI Master interface. In this function a semaphore is used to control access to the SPIMUART thread. In this way the application will never transfer data before interface configuration is complete.spimuart This function will read from the SPI Slave device connected to an SPI Master interface and write out to the UART. Data is read from the slave at the same time that data is written to the slave. Therefore data can only be received from the slave when data is written to it. 9

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 E-mail (Sales) E-mail (Support) E-mail (General Enquiries) sales1@ftdichip.com support1@ftdichip.com admin1@ftdichip.com Branch Office Hillsboro, Oregon, USA Future Technology Devices International Limited (USA) 7235 NW Evergreen Parkway, Suite 600 Hillsboro, OR 97123-5803 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 408, 317 Xianxia Road, Shanghai, 200051 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://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 10

Appendix A References Document References Application and Technical Notes available at http://www.ftdichip.com/support/documents/appnotes.htm VNC2 Datasheet V2-EVAL datasheet Vinculum II Toolchain AN_139 IO_Mux explained AN_151 Vinculum II User Guide AN_159_Vinculum_II_Firmware_Flash_Programming.pdf Project source code download http://www.ftdichip.com/firmware/precompiled/uart_spim.zip Project precompiled ROM file download http://www.ftdichip.com/firmware/precompiled/uart_spim.rom Acronyms and Abbreviations Terms UART USB USB-IF Description Universal Asynchronous Receiver Transmitter Universal Serial Bus USB Implementers Forum 11

Appendix B List of Tables & Figures List of Tables Table 3.1 VNC2 Pin-Out... 5 List of Figures Figure 2.1 Connecting the Demo... 3 Figure 4.1 Vinculum-II Project Open Button... 6 Figure 4.2 Vinculum-II IDE Build Button... 6 Figure 4.3 Vinculum-II IDE Flash Button... 6 Figure 4.4 FT_Prog Programming Utility... 7 12

Appendix C Revision History Document Title: AN_195 Vinculum-II UART to SPI_Master Bridge Clearance No.: FTDI#235 Product Page: http://www.ftdichip.com/products/ics/vnc2.htm Document Feedback: Send Feedback Revision Changes Date 1.0 Initial Release 15/11/11 13