Techwell TW88 Series User manual

TECHWELL
TW88XX
TECHWELL, INC.
User’s Manual:
TW
-
Dongle
TW88xx
TW-Dongle
User’s Manual
Techwell, Inc.
408 E. Plumeria Drive
San Jose, CA 95134
URL http://www.techwellinc.com
Disclaimer
This document provides technical information for the user. Techwell, Inc. reserves the right to modify the information in this
document as necessary. The customer should make sure that they have the most recent data sheet version. Techwell Inc.
holds no responsibility for any errors that may appear in this document. Customers should take appropriate action to ensure
their use of the products does not infringe upon any patents. Techwell Inc. respects valid patent rights of third parties and
does not infringe upon or assist others to infringe upon such rights.

TECHWELL
TW88XX
TECHWELL, INC. 2 10/20/2008
User’s Manual:
TW
-
Dongle
Document Revision History
Version Date Notes By
2.3 10/17/2007 Initial for this revision Van Nguyen
2.4 11/1/2007 added FLIP Download website Van Nguyen
2.5 11/6/2007 Added Pin Description for JP2,JP3 Van Nguyen
3.0 2/20/2008 Updated Information for TW-Dongle Rev1.3 Van Nguyen
4.0 10/20/2008 Updated Information for TW-Dongle Rev2.0 Van Nguyen

TECHWELL
TW88XX
TECHWELL, INC. 3 10/20/2008
User’s Manual:
TW
-
Dongle
Table Of Content
1) TW_Dongle..................................................................................................................................... 4
2) Start Driver installation (If needed) ................................................................................................. 4
3) Function of TW USB interface board............................................................................................. 6
4) TW_Dongle Modes......................................................................................................................... 6
5) Updating TW_Dongle Firmware.................................................................................................. 10

TECHWELL
TW88XX
TECHWELL, INC. 4 10/20/2008
User’s Manual:
TW
-
Dongle
1) TW_Dongle
This board is designed to interface a PC to the evaluation or custom designed board. It has three main
functional interfaces. It may be used as a USB-to-RS232, USB-to-I2C , or USB-to-SPI adapter. The USB
controller is programmable, and a driver is provided to be used with Techwell’s TW_Terminal application.
2) tart Driver installation (If needed)
Plugging in the TW_Dongle to a PC’s USB connector will automatically be detected. Following detection,
“Found New Hardware Wizard” window will show as below. Select “Install from a list or specific location
(Advanced).”
Windows will provide a browser for the user to specify the folder containing the driver. By default, it should
be located in “TW_Terminal2 and TW_Dongle.” Tw_USB1 is for Windows XP/2000 and Tw_USB_V is for
Windows Vista. A warning will appear, but click on “Continue Anyway.”

TECHWELL
TW88XX
TECHWELL, INC. 5 10/20/2008
User’s Manual:
TW
-
Dongle
Installation will take place, and the following window will appear after it is completed. Click on “Finish” to
close the wizard.
The driver’s status can be confirmed by clicking [Start] menu ->[Control Panel]->[Systerm]->[Hardware]->
[Device Manager]->[Port (COM&LPT)]. If the driver was successfully installed, the device should show up
in Ports as the picture shows below.

TECHWELL
TW88XX
TECHWELL, INC. 6 10/20/2008
User’s Manual:
TW
-
Dongle
3) Function of TW U B interface board
Components on the board
4)
TW_Dongle Modes
a) USB -> RS232
In this mode, TW_Dongle function same as a typical USB-to-UART adapter. The RS-232 interface
must be used with the 2 jumpers installed according to the figure below.
This mode can be chosen by selecting RS232 from TW_Terminal2. ([File]->[Setup]->[Connection])

TECHWELL
TW88XX
TECHWELL, INC. 7 10/20/2008
User’s Manual:
TW
-
Dongle
Please notice that Baud Rate may vary depending on the evaluation board used:
Baud Rate 115200 bps is for TW8808, TW8810, TW8811 board and TW8816 Extermal MCU mode.
Baud Rate 9600 bps is for TW8816, TW8817, and TW8827 Internal MCU mode.
Direct UART Signals
Direct connection of the Tx and Rx signals are also available with TW-Dongle Rev2 via the
headers. To bypass the connection to the RS-232 transceiver, the jumper may be removed and
a cable may be made to directly connect the Tx and Rx signal from the TW-Dongle
microcontroller to it’s respective receiving and transmitting connection on the target board.
There is also a jumper selection for 3.3V or 5V signal level. Settings in the terminal are the same
as for RS-232.
Header Connection Description ( J9 )
Pin No. Signal
1 Rx (uController side)
2 Rx (Max232 side)
3 Tx (uController side)
4 Tx (Max232 side)
5&6 GND
Tx/Rx Voltage Selection
Jumper
3.3V
5V

TECHWELL
TW88XX
TECHWELL, INC. 8 10/20/2008
User’s Manual:
TW
-
Dongle
b) USB -> I2C
This mode enables the TW_Dongle to utilize its I2C interface to communicate to the TW88xx board.
It will allow the PC to act like the master I2C device to write and read on the I2C 2-wire serial bus.
Header Connection Description ( JP1 )
Pin No. Signal
1 Enable(EN)
2 SCL
3 SDA
4 Ground
Arbitration of the I2C bus masters is required if there are two masters (One is to the PC and the other
may be on the target board; example is the external Winbond MCU on the TW8816 Evaluation
Board). The Enable(EN) pin from the TW_Dongle will function to arbitrate the occupancy of the I2C
bus.
The Enable pin can be controlled from the terminal, by typing command “e 0” or “e 1.”

TECHWELL
TW88XX
TECHWELL, INC. 9 10/20/2008
User’s Manual:
TW
-
Dongle
c) USB -> SPI
This mode is similar to I2C mode. The PC will be the master device on the SPI interface.
Pin Assignment (Used to Interface with Techwell’s Evaluation Boards)
JP3 JP2
Pin1: SPI_CSN (P0) (P4)
Pin2: SPI_SDI (P1) WP_N (P5)
Pin3: SPI_CLK (P2) RESET_N (P6)
Pin4: SPI_SDO (P3) MCU_EN(P7)
Pin5: Ground Ground
The TW_Dongle supports programming SPI flash memory if it is running firmware released on
2007/8/3 or later. The details of this procedure will be described in the next section for TW_Dongle
firmware updating. The SPI flash programming is useful in our TW88xx products that have an
embedded MCU.
When firmware upgrade is selected in the TW_Terminal application, the TW_Dongle mode will
automatically switch to SPI mode because it will need to download the firmware to SPI flash memory.
Again, there may be multiple bus masters and arbitration is required. To be able to access the SPI
flash using the TW_Dongle, the internal MCU in TW88xx should be disabled via the MCU_EN pin.
TW_Terminal provides the control for MCU_EN signal via pin 4 of JP2. During SPI programming
mode, this signal is held “low’ and is released to ‘high’ after programming is complete. The MCU will
start running the program without the need for another reset control.

TECHWELL
TW88XX
TECHWELL, INC. 10
10/20/2008
User’s Manual:
TW
-
Dongle
5) Updating TW_Dongle Firmware
The TW-Dongle utilizes an ISP (In-system programming) function of the on board ATMEL MCU to
update its firmware. This update may be necessary because there may be new features and functions
that older firmware may not support. This section will describe how to perform the update.
a) Download, Decompress the file flip-2_4_6.zip, and Install the software
Go to www.atmel.com and perform a search for FLIP. FLIP is the Flexible In-System Programmer
software used to update the firmware of the TW_Dongle via the USB. Install this software after
decompressing it.
b) Boot the TW_Dongle in ISP(In-system programming) mode
Press and hold the ISP button, then plug the TW_Dongle into a PC USB port. The board will boot in
ISP mode, and a new “Found new hardware wizard” dialog will show up. Follow the instruction and
install the driver located at the FLIP-2_4_0 installed directory in previous step. It will appear as a
“Jungo” device in Device Manager.

TECHWELL
TW88XX
TECHWELL, INC. 11
10/20/2008
User’s Manual:
TW
-
Dongle
c) Execute the FLIP program
It will appear as an icon shortcut in Start menu->Programs->ATMEL->FLIP
d) Click the button to configure the MCU type (AT89C5131).
e) Click the button. Select “USB” type and then click on “open” to access the port

TECHWELL
TW88XX
TECHWELL, INC. 12
10/20/2008
User’s Manual:
TW
-
Dongle
f) Load the firmware named “TWUSB.HEX” and click “Run” to update the firmware
g) Press “Reset” button of the TW_Dongle to restart with the new firmware
h) Check new firmware version by entering the TW_Terminal help message

TECHWELL
TW88XX
TECHWELL, INC. 13
10/20/2008
User’s Manual:
TW
-
Dongle
The version may only be checked when TW_Terminal is in USB-> I2C mode. Type “h” or “?” to see the
help message where the Revision Date is displayed.
a) Command List in I2C mode to control the Px’s pins on the TW_Dongle.
P <x> <x>: port write bit
P <x>: Port read bit
P A <xx>: Port write byte
(* Pin 1)
P A: Port read byte
Table of contents