PROGRAMING_EEPROM_FTDI.pdf

(368 KB) Pobierz
Microsoft Word - AN_105_FTDI_Device_Programming_Using_Vinculum_VNC1L
Future Technology Devices International Ltd.
Application Note AN_105
FTDI Device EEPROM Programming
Using a Vinculum VNC1L
Document Reference No.: FT_000078
Version 1.00
Issue Date: 2008-09-23
This document describes a C application that uses the VNC1L to program the EEPROM of an
FTDI peripheral device.
Future Technology Devices International Limited (FTDI)
373 Scotland Street, Glasgow G5 8QB United Kingdom
Tel.: +44 (0) 141 429 2777 Fax: + 44 (0) 141 429 2758
EMail (Support): vinculum.support@ftdichip.com Web: http://www.ftdichip.com
Copyright © 2008 Future Technology Devices International Limited
721517798.051.png
Document Reference No.: FT_000078
FTDI Device EEPROM Programming Using a Vinculum VNC1L Application Note AN_105
Version 1.00
Clearance No.: FTDI# 59
Table of Contents
1 Introduction............................................................................................ 2
1.1 Conventions ......................................................................................................... 2
1.2 Acronyms and Abbreviations ............................................................................. 3
2 Project Setup ......................................................................................... 4
2.1 Hardware Setup ................................................................................................... 4
2.2 Software Setup .................................................................................................... 5
2.2.1 TTL-232R-3V3 Drivers ............................................................................................................ 5
2.2.2 VNC1L Firmware ..................................................................................................................... 5
2.2.3 Alternative Application Code ................................................................................................... 5
3 EEPROM Firmware Commands ............................................................ 6
3.1 FTDI Erase EEPROM (FEE) ................................................................................. 6
3.2 Write EEPROM (FEW) .......................................................................................... 6
3.3 Read EEPROM (FER) ........................................................................................... 6
4 Application Code ................................................................................... 7
4.1 Subroutines for Setting up and Connecting to the TTL-232R-3V3 .................. 7
4.2 Subroutines for Setting up the VNC1L .............................................................. 7
4.2.1 Queue Status ........................................................................................................................... 8
4.2.2 Read Responses from VNC1L ................................................................................................ 8
4.2.3 Write Firmware commands to VNC1L ..................................................................................... 9
4.2.4 Shortened Command Set command (SCS) .......................................................................... 10
4.2.5 Firmware Version command (FWV) ...................................................................................... 10
4.2.6 Query Port command (QP) .................................................................................................... 10
4.2.7 Select Interface command (SC) ............................................................................................ 11
4.2.8 Query Device command (QD) ............................................................................................... 11
4.3 Subroutines for Reading and Writing to the EEPROM ................................... 13
4.3.1 Reading from an EEPROM (FER) ......................................................................................... 13
4.3.2 Writing to an EEPROM (FEW) .............................................................................................. 14
4.3.3 Writing to the EEPROM of an FTxxxR chip ........................................................................... 15
4.3.4 Checksum .............................................................................................................................. 17
5 Contact Information............................................................................. 18
Appendix A - References .......................................................................... 19
Appendix B - Revision History .................................................................. 20
Copyright © 2008 Future Technology Devices International Limited
1
721517798.062.png 721517798.073.png
Document Reference No.: FT_000078
FTDI Device EEPROM Programming Using a Vinculum VNC1L Application Note AN_105
Version 1.00
Clearance No.: FTDI# 59
1 Introduction
The VNC1L is a USB host controller IC which allows data to be transferred via USB to an FTDI peripheral
device (FTxxx). The FTDI devices may use an EEPROM to store USB device descriptors that can be
programmed over the USB. Programming is commonly done by connecting the FTDI device to a PC,
installing the required FTDI drivers and using the driver API functions to program the EEPROM of the
device. This application note describes how to configure the VNC1L to program the EEPROM of an FTDI
device.
Firmware available for the VNC1L allows the user to read, write and erase the EEPROM of an FTDI device.
These firmware commands can be used to reprogram the VID, PID, serial number, manufacturer string
and description string within the EEPROM of all existing FTDI peripheral devices connected to the VNC1L.
This can be achieved using a C application on a PC. The example code for Microsoft ® Visual Studio ® 2008
is available by request under NDA. Contact support1@ftdichip.com .
Any software code examples given in this document are for information only. The examples are not
guaranteed and are not supported by FTDI.
1.1 Conventions
The following conventions are used in this document:
Convention
Description
Monospaced type
Indicates input or output from the monitor.
Boldface monospaced type
Indicates input supplied by the user.
Italic monospaced type
Indicates binary characters (ASCII values of
characters).
Important
Signals that the information supplied is
important.
Note
Provide additional information about a topic.
Warning
Indicate potential damage to equipment or
loss of data.
:
Is used to show a range. For instance, a
range of bits 15:9 is bits 15 to 9 (inclusive)
of a binary value.
VNC1L
Indicated information specific to the VNC1L.
carriage return (0x0D).
space (0x20).
d
Represents a single decimal character (0 to
9).
x
Represents a single hexadecimal character
(0 to 9 and A to F).
c
Represents a binary character (0x00 to
0xFF).
<sp>
space
Copyright © 2008 Future Technology Devices International Limited
2
721517798.080.png 721517798.001.png 721517798.002.png 721517798.003.png 721517798.004.png 721517798.005.png 721517798.006.png 721517798.007.png 721517798.008.png 721517798.009.png 721517798.010.png 721517798.011.png 721517798.012.png 721517798.013.png 721517798.014.png 721517798.015.png 721517798.016.png 721517798.017.png 721517798.018.png 721517798.019.png 721517798.020.png 721517798.021.png 721517798.022.png 721517798.023.png 721517798.024.png 721517798.025.png 721517798.026.png 721517798.027.png 721517798.028.png 721517798.029.png 721517798.030.png
Document Reference No.: FT_000078
FTDI Device EEPROM Programming Using a Vinculum VNC1L Application Note AN_105
Version 1.00
Clearance No.: FTDI# 59
1.2 Acronyms and Abbreviations
Terms
Description
VID
USB Vendor ID
PID
USB Product ID
EEPROM
Electrically Erasable Programmable ReadOnly Memory
UART
Universal Asynchronous Receiver/Transmitter
TTL
Voltage levels between 0V and 5V
<>
Connection between two pins
ROM
Read Only Memory
FTD
Reflash file extension
Monitor
Command line interface which allows instructions to be given to the VNC1L and
responses to be returned.
LSB
Least Significant Byte is shown first when representing a multibyte number as a
sequence of bytes. For example, the number 0x55AAFF00 is stored or specified
as 4 bytes 0x00, 0xFF, 0xAA, and 0x55.
MSB
Most Significant Byte is shown first when representing a multibyte number as a
sequence of bytes. For example, the number 0x55AAFF00 is stored or specified
as 4 bytes 0x55, 0xAA, 0xFF, and 0x00.
FTxxx
Refers to the FT232R, FT245R, FT232B, FT245B and FT2232D/L/C chips.
DLL
Dynamically Linked Library
NDA
Nondisclosure Agreement
Table 1.1 Acronyms and Abbreviations
Copyright © 2008 Future Technology Devices International Limited
3
721517798.031.png 721517798.032.png 721517798.033.png 721517798.034.png 721517798.035.png 721517798.036.png 721517798.037.png 721517798.038.png 721517798.039.png 721517798.040.png 721517798.041.png 721517798.042.png 721517798.043.png 721517798.044.png 721517798.045.png 721517798.046.png 721517798.047.png 721517798.048.png 721517798.049.png 721517798.050.png 721517798.052.png 721517798.053.png 721517798.054.png 721517798.055.png 721517798.056.png 721517798.057.png 721517798.058.png 721517798.059.png 721517798.060.png 721517798.061.png 721517798.063.png
Document Reference No.: FT_000078
FTDI Device EEPROM Programming Using a Vinculum VNC1L Application Note AN_105
Version 1.00
Clearance No.: FTDI# 59
2 Project Setup
2.1 Hardware Setup
The hardware required in this application is an FTDI VDIP1 development module and an FTDI TTL232R
3V3 cable. The VDIP1 module contains a VNC1L. A PC is used to communicate with the VNC1L on the
VDIP1 via the TTL2323V3 cable. The cable connects to the USB port of a PC and converts USB
signalling to a serial UART interface (at TTL levels). The serial UART signals connect to the VDIP1 module
via a six way header. The pin out for the six way header is described in Table 2.1 and Figure 2.1. The
monitor port of the VDIP1 must be configured in UART mode by setting the jumper links J3 and J4 on the
VDIP1 module as shown in Figure 2.1.
Figure 2.1 Jumper Configuration and TTL-232R-3V3 Connection on VDIP1
TTL Cable Header
Pin Number
TTL Cable
Header Pin Name
VDIP1 Pin Name VDIP1 Pin Number
Pin 1 (Black)
GND
<>
GND
Pin 7
Pin 2 (Brown)
CTS#
<>
ADBUS2 (RTS#) Pin 9
Pin 3 (Red)
VCC
<>
5V
Pin 1
Pin 4 (Orange)
TXD
<>
ADBUS1 (RXD) Pin 8
Pin 5 (Yellow)
RXD
<>
ADBUS0 (TXD) Pin 6
Pin 6 (Green)
RTS#
<>
ADBUS3 (CTS#) Pin 10
Table 2.1 Pin Connections Between VDIP1 and TTL-232R-3V3
An alternative setup would be to attach a MCU or FPGA to the monitor port of the VDIP1 instead of the PC
and TTL232R3V3 cable.
To program the EEPROM of an FTxxx peripheral device, connect the USB socket of the FTxxx device into
the USB host port on the VDIP1 and then run the C application on the PC.
Copyright © 2008 Future Technology Devices International Limited
4
721517798.064.png 721517798.065.png 721517798.066.png 721517798.067.png 721517798.068.png 721517798.069.png 721517798.070.png 721517798.071.png 721517798.072.png 721517798.074.png 721517798.075.png 721517798.076.png 721517798.077.png 721517798.078.png 721517798.079.png
Zgłoś jeśli naruszono regulamin