Tusb 3410
Tusb 3410
Tusb 3410
Data Manual
January 2010
Contents
Contents
Section 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Controller Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Ordering Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 USB Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 General Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Enhanced UART Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4 Terminal Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Detailed Controller Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 USB Interface Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 External Memory Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Host Download Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 USB Data Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 Serial Port Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Serial Port Data Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 RS-232 Data Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2 RS-485 Data Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.3 IrDA Data Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MCU Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 Miscellaneous Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 ROMS: ROM Shadow Configuration Register (Addr:FF90h) . . . . . . . . . . . . . . . . . . . 4.1.2 Boot Operation (MCU Firmware Loading) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.3 WDCSR: Watchdog Timer, Control, and Status Register (Addr:FF93h) . . . . . . . . . 4.2 Buffers + I/O RAM Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Endpoint Descriptor Block (EDB1 to EDB3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.1 OEPCNF_n: Output Endpoint Configuration (n = 1 to 3) (Base Addr: FF08h, FF10h, FF18h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.2 OEPBBAX_n: Output Endpoint X-Buffer Base Address (n = 1 to 3) (Offset 1) . . . . 4.3.3 OEPBCTX_n: Output Endpoint X Byte Count (n = 1 to 3) (Offset 2) . . . . . . . . . . . . 4.3.4 OEPBBAY_n: Output Endpoint Y-Buffer Base Address (n = 1 to 3) (Offset 5) . . . . 4.3.5 OEPBCTY_n: Output Endpoint Y-Byte Count (n = 1 to 3) (Offset 6) . . . . . . . . . . . . 4.3.6 OEPSIZXY_n: Output Endpoint X-/Y-Buffer Size (n = 1 to 3) (Offset 7) . . . . . . . . . 4.3.7 IEPCNF_n: Input Endpoint Configuration (n = 1 to 3) (Base Addr: FF48h, FF50h, FF58h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.8 IEPBBAX_n: Input Endpoint X-Buffer Base Address (n = 1 to 3) (Offset 1) . . . . . . 4.3.9 IEPBCTX_n: Input Endpoint X-Byte Count (n = 1 to 3) (Offset 2) . . . . . . . . . . . . . . 4.3.10 IEPBBAY_n: Input Endpoint Y-Buffer Base Address (n = 1 to 3) (Offset 5) . . . . . . 4.3.11 IEPBCTY_n: Input Endpoint Y-Byte Count (n = 1 to 3) (Offset 6) . . . . . . . . . . . . . . . 4.3.12 IEPSIZXY_n: Input Endpoint X-/Y-Buffer Size (n = 1 to 3) (Offset 7) . . . . . . . . . . . . 4.4 Endpoint-0 Descriptor Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.1 IEPCNFG_0: Input Endpoint-0 Configuration Register (Addr:FF80h) . . . . . . . . . . . 4.4.2 IEPBCNT_0: Input Endpoint-0 Byte Count Register (Addr:FF81h) . . . . . . . . . . . . . 4.4.3 OEPCNFG_0: Output Endpoint-0 Configuration Register (Addr:FF82h) . . . . . . . . . 4.4.4 OEPBCNT_0: Output Endpoint-0 Byte Count Register (Addr:FF83h) . . . . . . . . . . . Page 1 1 2 3 5 5 5 5 6 9 9 9 9 9 9 9 9 10 10 10 13 14 14 14 15 15 18 19 19 20 20 20 21 21 21 22 22 22 23 23 23 24 24 24
May 2008
SLLS519G
iii
Contents
Section 5 USB Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 FUNADR: Function Address Register (Addr:FFFFh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 USBSTA: USB Status Register (Addr:FFFEh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 USBMSK: USB Interrupt Mask Register (Addr:FFFDh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 USBCTL: USB Control Register (Addr:FFFCh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 MODECNFG: Mode Configuration Register (Addr:FFFBh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6 Vendor ID/Product ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.7 SERNUM7: Device Serial Number Register (Byte 7) (Addr:FFEFh) . . . . . . . . . . . . . . . . . . . . . . 5.8 SERNUM6: Device Serial Number Register (Byte 6) (Addr:FFEEh) . . . . . . . . . . . . . . . . . . . . . . 5.9 SERNUM5: Device Serial Number Register (Byte 5) (Addr:FFEDh) . . . . . . . . . . . . . . . . . . . . . . 5.10 SERNUM4: Device Serial Number Register (Byte 4) (Addr:FFECh) . . . . . . . . . . . . . . . . . . . . . . 5.11 SERNUM3: Device Serial Number Register (Byte 3) (Addr:FFEBh) . . . . . . . . . . . . . . . . . . . . . . 5.12 SERNUM2: Device Serial Number Register (Byte 2) (Addr:FFEAh) . . . . . . . . . . . . . . . . . . . . . . 5.13 SERNUM1: Device Serial Number Register (Byte 1) (Addr:FFE9h) . . . . . . . . . . . . . . . . . . . . . . 5.14 SERNUM0: Device Serial Number Register (Byte 0) (Addr:FFE8h) . . . . . . . . . . . . . . . . . . . . . . 5.15 Function Reset And Power-Up Reset Interconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.16 Pullup Resistor Connect/Disconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DMA Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 DMA Controller Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.1 DMACDR1: DMA Channel Definition Register (UART Transmit Channel) (Addr:FFE0h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.2 DMACSR1: DMA Control And Status Register (UART Transmit Channel) (Addr:FFE1h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.3 DMACDR3: DMA Channel Definition Register (UART Receive Channel) (Addr:FFE4h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1.4 DMACSR3: DMA Control And Status Register (UART Receive Channel) (Addr:FFE5h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Bulk Data I/O Using the EDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.1 IN Transaction (TUSB3410 to Host) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.2 OUT Transaction (Host to TUSB3410) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 UART Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.1 RDR: Receiver Data Register (Addr:FFA0h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.2 TDR: Transmitter Data Register (Addr:FFA1h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.3 LCR: Line Control Register (Addr:FFA2h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.4 FCRL: UART Flow Control Register (Addr:FFA3h) . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.5 Transmitter Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.6 MCR: Modem-Control Register (Addr:FFA4h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.7 LSR: Line-Status Register (Addr:FFA5h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.8 MSR: Modem-Status Register (Addr:FFA6h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.9 DLL: Divisor Register Low Byte (Addr:FFA7h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.10 DLH: Divisor Register High Byte (Addr:FFA8h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.11 Baud-Rate Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.12 XON: Xon Register (Addr:FFA9h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.13 XOFF: Xoff Register (Addr:FFAAh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.14 MASK: UART Interrupt-Mask Register (Addr:FFABh) . . . . . . . . . . . . . . . . . . . . . . . .
Page 25 25 25 26 27 27 28 28 29 29 29 29 30 30 30 31 31 33 33 34 34 35 36 36 37 38 39 39 39 39 40 41 42 43 44 46 46 47 47 47 48 48
iv
SLLS519G
May 2008
Contents
Section UART Data Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.1 Receiver Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.2 Hardware Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.3 Auto RTS (Receiver Control) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.4 Auto CTS (Transmitter Control) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.5 Xon/Xoff Receiver Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2.6 Xon/Xoff Transmit Flow Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Expanded GPIO Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1 Input/Output and Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1.1 PUR_3: GPIO Pullup Register For Port 3 (Addr:FF9Eh) . . . . . . . . . . . . . . . . . . . . . . 9 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1 8052 Interrupt and Status Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.1 8052 Standard Interrupt Enable (SIE) Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.2 Additional Interrupt Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.3 VECINT: Vector Interrupt Register (Addr:FF92h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1.4 Logical Interrupt Connection Diagram (Internal/External) . . . . . . . . . . . . . . . . . . . . . . 10 I2C Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1 I2C Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.1 I2CSTA: I2C Status and Control Register (Addr:FFF0h) . . . . . . . . . . . . . . . . . . . . . . 10.1.2 I2CADR: I2C Address Register (Addr:FFF3h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.3 I2CDAI: I2C Data-Input Register (Addr:FFF2h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1.4 I2CDAO: I2C Data-Output Register (Addr:FFF1h) . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.2 Random-Read Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.3 Current-Address Read Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.4 Sequential-Read Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.5 Byte-Write Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.6 Page-Write Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 TUSB3410 Bootcode Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Bootcode Programming Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Default Bootcode Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3.1 Device Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3.2 Configuration Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3.3 Interface Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3.4 Endpoint Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3.5 String Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.4 External I2C Device Header Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.4.1 Product Signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.4.2 Descriptor Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.5 Checksum in Descriptor Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6 Header Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.1 TUSB3410 Bootcode Supported Descriptor Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.2 USB Descriptor Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.6.3 Autoexec Binary Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.7 USB Host Driver Downloading Header Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2
Page 48 48 49 49 49 50 50 51 51 51 53 53 53 53 54 55 57 57 57 58 58 58 58 59 59 60 61 63 63 63 64 64 65 66 66 66 68 68 69 69 69 69 69 71 72
May 2008
SLLS519G
Contents
Section Built-In Vendor Specific USB Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.8.1 Reboot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.8.2 Force Execute Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.8.3 External Memory Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.8.4 External Memory Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.8.5 I2C Memory Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.8.6 I2C Memory Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.8.7 Internal ROM Memory Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.9 Bootcode Programming Consideration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.9.1 USB Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.9.2 Hardware Reset Introduced by the Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.10 File Listings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Electrical Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.1 Absolute Maximum Ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.2 Commercial Operating Condition (3.3 V) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.3 Electrical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Application Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13.1 Crystal Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13.2 External Circuit Required for Reliable Bus Powered Suspend Operation . . . . . . . . . . . . . . . . . . 13.3 Wakeup Timing (WAKEUP or RI/CP Transitions) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13.4 Reset Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.8
Page 72 72 72 73 73 73 73 74 74 74 77 78 79 79 79 79 81 81 81 82 82
vi
SLLS519G
May 2008
List of Illustrations
List of Illustrations
Figure
11 12 31 32 33 41 51 52 71 72 73 91 111 112 131 132 133
Title
Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . USB-to-Serial (Single Channel) Controller Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RS-232 and IR Mode Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . USB-to-Serial Implementation (RS-232) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RS-485 Bus Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MCU Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reset Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pullup Resistor Connect/Disconnect Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MSR and MCR Registers in Loop-Back Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Receiver/Transmitter Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Auto Flow Control Interconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Internal Vector Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Control Read Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Control Write Transfer Without Data Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Crystal Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . External Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reset Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Page
1 2 11 12 12 13 31 31 45 49 49 55 75 76 81 81 82
May 2008
SLLS519G
vii
List of Tables
List of Tables
Table
21 41 42 43 44 45 46 47 61 62 71 72 73 74 91 92 111 112 113 114 115 116 117 118 119 1110 1111
Title
Terminal Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ROM/RAM Size Definition Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . XDATA Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Memory-Mapped Registers Summary (XDATA Range = FF80h FFFFh) . . . . . . . . . . . . . . . . . . . . EDB Memory Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Endpoint Registers and Offsets in RAM (n = 1 to 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Endpoint Registers Base Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Input/Output EDB-0 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DMA Controller Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DMA IN-Termination Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UART Registers Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transmitter Flow-Control Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Receiver Flow-Control Possibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DLL/DLH Values and Resulted Baud Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8052 Interrupt Location Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Vector Interrupt Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Device Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuration Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interface Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Output Endpoint1 Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . String Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . USB Descriptors Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Autoexec Binary Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Host Driver Downloading Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bootcode Response to Control Read Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bootcode Response to Control Write Without Data Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Vector Interrupt Values and Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Page
7 14 15 16 17 19 19 23 33 36 39 42 42 47 53 54 65 65 66 66 67 70 72 72 75 76 77
viii
SLLS519G
May 2008
Introduction
1
1.1
Introduction
Controller Description
The TUSB3410 provides bridging between a USB port and an enhanced UART serial port. The TUSB3410 contains all the necessary logic to communicate with the host computer using the USB bus. It contains an 8052 microcontroller unit (MCU) with 16K bytes of RAM that can be loaded from the host or from the external on-board memory via an I2C bus. It also contains 10K bytes of ROM that allow the MCU to configure the USB port at boot time. The ROM code also contains an I2C boot loader. All device functions, such as the USB command decoding, UART setup, and error reporting, are managed by the internal MCU firmware under the auspices of the PC host. The TUSB3410 can be used to build an interface between a legacy serial peripheral device and a PC with USB ports, such as a legacy-free PC. Once configured, data flows from the host to the TUSB3410 via USB OUT commands and then out from the TUSB3410 on the SOUT line. Conversely, data flows into the TUSB3410 on the SIN line and then into the host via USB IN commands.
Out SOUT Host (PC or On-The-Go Dual-Role Device) USB In TUSB3410 SIN Legacy Serial Peripheral
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
Introduction
12 MHz Clock Oscillator 8052 Core
24 MHz
DP, DM
USB TxR
2 16-Bit Timers
I2C Bus
SIN
IR Encoder
M U X
SOUT/IR_SOUT
M U X
IR Decoder
SIN/IR_SIN
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
Introduction
1.2
Ordering Information
PACKAGED DEVICES TA 32-TERMINAL LQFP PACKAGE TUSB3410 I VF 32-TERMINAL QFN PACKAGE TUSB3410 I RHB TUSB3410 I RHBR TUSB3410 VF TUSB3410 RHB TUSB3410 RHBR Shipped in trays Industrial temperature range Tape and Reel Option Shipped in trays Tape and Reel Option COMMENT Industrial temperature range
0C to 70C
1.3
Version
Revision History
Date Mar2002 Changes Initial Release 1. 2. 3. 4. General grammatical corrections Added Designin warning on cover sheet Removed references to Optional preprogrammed VID/PID Registers from Section 5.1.6 through 5.1.11. Renumber the remainder of Section 5.1 accordingly option no longer supported. Clarified GPIO pin availability Removed Designin warning from cover sheet Added Note 8 to Terminal Functions Table for GPIO Pins. Removed Section 3.2.3 Production Programming Mode Mode no longer supported. Added Clock Output Control description to section 5.1.5. Removed Section 11.6.4 USB Descriptor with Binary Firmware Added Icc Spec to Table 12.3 Added Industrial Temperature Option and Information Added USB Logo to Cover General grammatical corrections Numerous technical corrections Added ordering information for TUSB3410IRHBR and TUSB3410RHBR Added terminal assignments for RHB package Removed reference to 48-MHz in 13.4
Apr2002
Jun2002
1. 2. 3. 4. 5. 6. 1. 2. 1. 2. 1. 1. 1.
C D F G H
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
Introduction
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
Main Features
2
2.1
Main Features
USB Features
Fully compliant with USB 2.0 full speed specifications: TID #40340262 Supports 12-Mbps USB data rate (full speed) Supports USB suspend, resume, and remote wakeup operations Supports two power source modes: Bus-powered mode Self-powered mode
Can support a total of three input and three output (interrupt, bulk) endpoints
2.2
General Features
Integrated 8052 microcontroller with 256 8 RAM for internal data 10K 8 ROM (with USB and I2C boot loader) 16K 8 RAM for code space loadable from host or I2C port 2K 8 shared RAM used for data buffers and endpoint descriptor blocks (EDB) Four GPIO terminals from 8052 port 3 Master I2C controller for EEPROM device access MCU operates at 24 MHz providing 2 MIPS operation 128-ms watchdog timer
Built-in two-channel DMA controller for USB/UART bulk I/O Operates from a 12-MHz crystal Supports USB suspend and resume Supports remote wake-up Available in 32-terminal LQFP 3.3-V operation with 1.8-V core operating voltage provided by on-chip 1.8-V voltage regulator
2.3
Automatic RS-485 bus transceiver control, with and without echo Selectable IrDA mode for up to 115.2 kbps transfer Software selectable baud rate from 50 to 921.6 k baud Programmable serial-interface characteristics 5-, 6-, 7-, or 8-bit characters Even, odd, or no parity-bit generation and detection 1-, 1.5-, or 2-stop bit generation
TUSB3410, TUSB3410I 5
SLLS519HJanuary 2010
Main Features
Line break generation and detection Internal test and loop-back capabilities Modem-control functions (CTS, RTS, DSR, DTR, RI, and DCD) Internal diagnostics capability Loopback control for communications link-fault isolation Break, parity, overrun, framing-error simulation
2.4
Terminal Assignment
VF PACKAGE (TOP VIEW)
24 23 22 21 20 19 18 17
1 32 31 30 29 28 27 26
SLLS519HJanuary 2010
Main Features
PWR 3.3 V PWR 1.8-V supply. An internal voltage regulator generates this supply voltage when terminal VREGEN is low. When VREGEN is high, 1.8 V must be supplied externally. I I I O This active-low terminal is used to enable the 3.3-V to 1.8-V voltage regulator. Remote wake-up request terminal. When low, wakes up system (see Note 5) 12-MHz crystal input or clock input 12-MHz crystal output
3-state CMOS output (4-mA drive/sink) 3-state CMOS output (8-mA drive/sink) 3-state CMOS output (12-mA drive/sink) TTL-compatible, hysteresis input TTL-compatible, hysteresis input, with internal 100-A active pullup resistor TTL-compatible input without hysteresis, with internal 100-A active pullup resistor Normal or IR mode: 3-state CMOS output (4-mA drive/sink) The MCU treats the outputs as open drain types in that the output can be driven low continuously, but a high output is driven for two clock cycles and then the output is high impedance.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
Main Features
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
3
3.1
3.2
3.3
3.4
3.5
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
10
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
0 M U X SOUT/IR_SOUT Terminal
SOUT
IR Encoder
IR_TX
0 M U X 1
0 M U X 3.556 MHz CLKSLCT (in MODECNFG Register) 0 To UART Receiver SIN M U X 1 IR_RX IR Decoder SIN/IR_SIN Terminal 1
CLKOUT Terminal
3.3 V
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
11
USB-0
12 MHz
USB-0
DP DM
TUSB3410
RS-485 Transceiver
1-Bit Max
DTR
RTS
CODE 0000h
10K Boot ROM (16K) Read/Write 27FFh 16K Code RAM Read Only
3FFFh
8000h
A7FFh
MMR
MMR
4.1
Miscellaneous Registers
SDW = 1
41 65
RSVD S[1:0]
No effect No effect
These bits are always read as 0000b. Code space size. These bits define the ROM or RAM code-space size (bit 7 (ROA) defines ROM or RAM). These bits are permanently set to 10b, indicating 16K bytes of code space, and are not affected by reset (see Table 41). 00 = 4K bytes code space size 01 = 8K bytes code space size 10 = 16K bytes code space size 11 = 32K bytes code space size
ROA
No effect
ROM or RAM version. This bit indicates whether the code space is RAM or ROM based. This bit is permanently set to 1, indicating the code space is RAM, and is not affected by reset (see Table 41). ROA = 0 Code space is ROM ROA = 1 Code space is RAM
S1 0 0 1 1 0 0 1 1
S0 0 1 0 1 0 1 0 1
BOOT ROM None None None None 10K 10K 10K 10K
ROM CODE 4K 8K 16K (reserved) 32K (reserved) None None None None
and writes to the 16K RAM in XDATA space. If it does not contain the code, then the MCU proceeds to boot from the USB. Once the code is loaded, the MCU sets the SDW bit to 1 in the ROMS register. This switches the memory map to normal mode; that is, the 16K RAM is mapped to code space, and the MCU starts executing from location 0000h. Once the switch is done, the MCU sets the CONT bit to 1 in the USBCTL register. This connects the device to the USB and results in normal USB device enumeration.
51 6
WDD[5:1] WDR
00000 0
This bit is one of the six disable bits for the watchdog timer. This bit must be cleared in order for the watchdog timer to be disabled.
4.2
Internal MMRs (Memory-Mapped Registers) EDB (Endpoint Descriptors Block) Setup Packet Input Endpoint-0 Buffer Output Endpoint-0 Buffer Data Buffers
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
15
16
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
Table 43. Memory-Mapped Registers Summary (XDATA Range = FF80h FFFFh) (Continued)
ADDRESS REGISTER DESCRIPTION Watchdog timer control and status register Vector interrupt register ROM shadow configuration register Output endpoint_0: Byte count register Output endpoint_0: Configuration register Input endpoint_0: Byte count register Input endpoint_0: Configuration register
FF9DhFF94h Reserved FF93h WDCSR FF92h FF91h FF90h FF8FhFF84h FF83h FF82h FF81h FF80h VECINT Reserved ROMS Reserved OEPBCNT_0 OEPCNFG_0 IEPBCNT_0 IEPCNFG_0
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
17
4.3
18
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
4.3.1 OEPCNF_n: Output Endpoint Configuration (n = 1 to 3) (Base Addr: FF08h, FF10h, FF18h)
7 UBME R/W BIT 10 2 NAME RSV USBIE 6 ISO=0 R/W RESET x x Reserved = 0 USB interrupt enable on transaction completion. Set/cleared by the MCU. USBIE = 0 No interrupt on transaction completion USBIE = 1 Interrupt on transaction completion USB stall condition indication. Set/cleared by the MCU. STALL = 0 STALL = 1 4 DBUF x No stall USB stall condition. If set by the MCU, then a STALL handshake is initiated and the bit is cleared by the MCU. 5 TOGLE R/W 4 DBUF R/W 3 STALL R/W 2 USBIE R/W FUNCTION 1 RSV R/W 0 RSV R/W
STALL
Double-buffer enable. Set/cleared by the MCU. DBUF = 0 Primary buffer only (X-buffer only) DBUF = 1 Toggle bit selects buffer USB toggle bit. This bit reflects the toggle sequence bit of DATA0, DATA1. ISO = 0 Nonisochronous transfer. This bit must be cleared by the MCU since only nonisochronous transfer is supported. USB buffer manager (UBM) enable/disable bit. Set/cleared by the MCU. UBME = 0 UBM cannot use this endpoint UBME = 1 UBM can use this endpoint
5 6 7
x x x
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
19
NAK
NAK
20
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
RSV
4.3.7 IEPCNF_n: Input Endpoint Configuration (n = 1 to 3) (Base Addr: FF48h, FF50h, FF58h)
7 UBME R/W BIT 10 2 NAME RSV USBIE 6 ISO=0 R/W RESET x x Reserved = 0 USB interrupt enable on transaction completion USBIE = 0 No interrupt on transaction completion USBIE = 1 Interrupt on transaction completion USB stall condition indication. Set by the UBM but can be set/cleared by the MCU STALL = 0 No stall STALL = 1 USB stall condition. If set by the MCU, then a STALL handshake is initiated and the bit is cleared automatically. Double buffer enable DBUF = 0 Primary buffer only (X-buffer only) DBUF = 1 Toggle bit selects buffer USB toggle bit. This bit reflects the toggle sequence bit of DATA0, DATA1 ISO = 0 Nonisochronous transfer. This bit must be cleared by the MCU since only nonisochronous transfer is supported UBM enable/disable bit. Set/cleared by the MCU UBME = 0 UBM cannot use this endpoint UBME = 1 UBM can use this endpoint 5 TOGLE R/W 4 DBUF R/W 3 STALL R/W 2 USBIE R/W FUNCTION 1 RSV R/W 0 RSV R/W
STALL
DBUF
5 6 7
x x x
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
21
NAK
4.3.10
7 A10 R/W BIT 70
4.3.11
7 NAK R/W BIT 60
NAK
22
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
4.3.12
7 RSV R/W BIT 60
RSV
4.4
STALL
4 5 6 7
0 0 0 0
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
23
64 7
RSV NAK
0 1
STALL
4 5 6 7
0 0 0 0
64 7
RSV NAK
0 1
24
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
USB Registers
5
5.1
USB Registers
FUNADR: Function Address Register (Addr:FFFFh)
This register contains the device function address.
7 RSV R/O BIT 60 7 NAME FA[6:0] RSV 6 FA6 R/W RESET 0 0 5 FA5 R/W 4 FA4 R/W 3 FA3 R/W 2 FA2 R/W FUNCTION These bits define the current device address assigned to the function. The MCU writes a value to this register because of the SET-ADDRESS host command. Reserved = 0 1 FA1 R/W 0 FA0 R/W
5.2
BIT 0
WAKEUP
Remote wakeup bit WAKEUP = 0 WAKEUP = 1 The MCU can clear this bit by writing a 1 (writing 0 has no effect). Remote wakeup request from WAKEUP terminal
SETUP
SETUP transaction received bit. As long as SETUP is 1, IN and OUT on endpoint-0 are NAKed, regardless of their real NAK bits value. SETUP = 0 SETUP = 1 MCU can clear this bit by writing a 1 (writing 0 has no effect). SETUP transaction received
URRI
UART RI (ring indicate) status bit a rising edge causes this bit to be set. URRI = 0 URRI = 1 The MCU can clear this bit by writing a 1 (writing 0 has no effect). Ring detected, which is used to wake the chip up (bring it out of suspend).
4 5
RSV RESR
0 0
Reserved Function resume request bit RESR = 0 RESR = 1 The MCU can clear this bit by writing a 1 (writing 0 has no effect). Function resume is detected
SUSR
Function suspended request bit. This bit is set in response to a global or selective suspend condition. SUSR = 0 SUSR = 1 The MCU can clear this bit by writing a 1 (writing 0 has no effect). Function suspend is detected
RSTR
Function reset request bit. This bit is set in response to the USB host initiating a port reset. This bit is not affected by the USB function reset. RSTR = 0 RSTR = 1 The MCU can clear this bit by writing a 1 (writing 0 has no effect). Function reset is detected
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
25
USB Registers
5.3
BIT 0
WAKEUP
Remote wakeup interrupt enable bit WAKEUP = 0 WAKEUP = 1 WAKEUP interrupt disable WAKEUP interrupt enable
SETUP
SETUP interrupt enable bit SETUP = 0 SETUP = 1 SETUP interrupt disabled SETUP interrupt enabled
URRI
UART RI interrupt enable bit URRI = 0 URRI = 1 UART RI interrupt disable UART RI interrupt enable
4 5
RSV RESR
0 0
Reserved Function resume interrupt enable bit RESR = 0 RESR = 1 Function resume interrupt disabled Function resume interrupt enabled
SUSR
Function suspend interrupt enable SUSR = 0 SUSR = 1 Function suspend interrupt disabled Function suspend interrupt enabled
RSTR
Function reset interrupt bit. This bit is not affected by USB function reset. RSTR = 0 RSTR = 1 Function reset interrupt disabled Function reset interrupt enabled
26
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
USB Registers
5.4
BIT 0
NAME DIR
SIR
SETUP interrupt-status bit. This bit is controlled by the MCU to indicate to the hardware when the SETUP interrupt is being serviced. SIR = 0 SIR = 1 SETUP interrupt is not served. The MCU clears this bit before exiting the SETUP interrupt routine. SETUP interrupt is in progress. The MCU sets this bit when servicing the SETUP interrupt.
2 3 4
0 0 1
Reserved = 0 This bit must always be written as 0. Function reset-connection bit. This bit connects/disconnects the USB function reset to/from the MCU reset. FRSTE = 0 FRSTE = 1 Function reset is not connected to MCU reset Function reset is connected to MCU reset
RWUP
Device remote wakeup request. This bit is set by the MCU and is cleared automatically. RWUP = 0 RWUP = 1 Writing a 0 to this bit has no effect When MCU writes a 1, a remote-wakeup pulse is generated.
IREN
IR mode enable. This bit is set and cleared by firmware. IREN = 0 IREN = 1 IR encoder/decoder is disabled, UART mode is selected IR encoder/decoder is enabled, UART mode is deselected
CONT
Connect/disconnect bit CONT = 0 CONT = 1 Upstream port is disconnected. Pullup disabled. Upstream port is connected. Pullup enabled.
5.5
BIT 0
SOFTSW
Soft switch: Firmware controllable 3-state output buffer enable for serial output terminal. SOFTSW = 0 SOFTSW = 1
CLKOUTEN
Clock output enable: Enables/disables the clock output at CLKOUT terminal. CLKOUTEN = 0 CLKOUTEN = 1
CLKSLCT
Clock output source select: Selects between 3.556-MHz fixed clock or UART baud out clock as output clock source. CLKSLCT = 0 CLKSLCT = 1 UART baud out clock is selected as clock output Fixed 3.556-MHz free running clock is selected as clock output
47
RSV
Reserved
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
27
USB Registers
5.6
Vendor ID/Product ID
USBIF and Microsoft WHQL certification requires that end equipment makers use their own unique vendor ID and product ID for each product (model). OEMs cannot use silicon vendors (for instance, TIs default) VID/PID in their end products. A unique VID/PID combination will avoid potential driver conflicts and enable logo certification. See www.usb.org for more information.
5.7
BIT 70
Procedure to load device serial number value in shared RAM: After power-up reset, the boot code copies the predefined USB descriptors to shared RAM. As a result, the default serial number hard-coded in the boot code (0x00 hex) is copied to the shared RAM data space. The boot code checks to see if an EEPROM is present on the I2C port. If an EEPROM is present and contains a valid device serial number as part of the USB device descriptor information stored in EEPROM, then the boot code overwrites the serial number value stored in shared RAM with the one found in EEPROM. Otherwise, the device serial number value stored in shared RAM remains unchanged. If firmware is stored in the EEPROM, then it is executed. This firmware can read the SERNUM7 through SERNUM0 registers and overwrite the serial number stored in RAM or store a custom number in RAM. In summary, the serial number value in external EEPROM has the highest priority to be loaded into shared RAM data space. The serial number value stored in shared RAM is used as part of the valid device descriptor information during normal operation.
28
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
USB Registers
5.8
BIT 70
NOTE: See the procedure described in the SERNUM7 register (see Section 5.7) to load the device serial number into shared RAM.
5.9
BIT 70
NOTE: See the procedure described in the SERNUM7 register (see Section 5.7) to load the device serial number into shared RAM.
NOTE: See the procedure described in the SERNUM7 register (see Section 5.7) to load the device serial number into shared RAM.
NOTE: See the procedure described in the SERNUM7 register (see Section 5.7) to load the device serial number into shared RAM.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
29
USB Registers
NOTE: See the procedure described in the SERNUM7 register (see Section 5.7) to load the device serial number into shared RAM.
NOTE: See the procedure described in the SERNUM7 register (see Section 5.7) to load the device serial number into shared RAM.
NOTE: See the procedure described in the SERNUM7 register (see Section 5.7) to load the device serial number into shared RAM.
30
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
USB Registers
RESET
PURS USBR
RESET
G2
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
31
USB Registers
32
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
DMA Controller
DMA Controller
Table 61 outlines the DMA channels and their associated transfer directions. Two channels are provided for data transfer between the host and the UART. Table 61. DMA Controller Registers
DMA CHANNEL DMA1 DMA3 TRANSFER DIRECTION Host to UART UART to host COMMENTS DMA writes to UART TDR register DMA reads from UART RDR register
6.1
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
33
DMA Controller
6.1.1 DMACDR1: DMA Channel Definition Register (UART Transmit Channel) (Addr:FFE0h)
These registers define the EDB number that the DMA uses for data transfer to the UARTS. In addition, these registers define the data transfer direction and selects X or Y as the transaction buffer.
7 EN R/W BIT 20 3 4 NAME E[2:0] T/R XY 6 INE R/W RESET 0 0 0 5 CNT R/W 4 XY R/W 3 T/R R/O FUNCTION Endpoint descriptor pointer. This field points to a set of EDB registers that is to be used for a given transfer. This bit is always 1, indicating that the DMA data transfer is from SRAM to the UART TDR register (see Section 7.1.2). (The MCU cannot change this bit.) X/Y buffer select bit. XY = 0 XY = 1 5 CNT 0 Next buffer to transmit/receive is the X buffer Next buffer to transmit/receive is the Y buffer 2 E2 R/W 1 E1 R/W 0 E0 R/W
DMA continuous transfer control bit. This bit defines the mode of the DMA transfer. This bit must always be written as 1. In this mode, the DMA and UBM alternate between the X- and Y-buffers. The DMA sets bit 4 (XY) and the UBM uses it for the transfer. The DMA alternates between the X-/Y-buffers and continues transmitting (from X-/Y-buffer) without MCU intervention. The DMA terminates, and interrupts the MCU, under the following conditions: 1. When the UBM byte count < buffer size (in EDB), the DMA transfers the partial packet and interrupt the MCU on completion. 2. Transaction timer expires. The DMA interrupts the MCU.
INE
DMA Interrupt enable/disable bit. This bit enables/disables the interrupt on transfer completion. INE = 0 INE = 1 Interrupt is disabled. In addition, bit 0 (PPKT) in the DMACSR1 register (see Section 6.1.2) does not clear bit 7 (EN) and the DMAC is not disabled. Enables the EN interrupt. When this bit is set, the DMA interrupts the MCU on a 1 to 0 transition of the bit 7 (EN). (When transfer is completed, EN = 0.)
EN
DMA channel enable bit. The MCU sets this bit to start the DMA transfer. When the transfer completes, or when it is terminated due to error, this bit is cleared. The 1 to 0 transition of this bit generates an interrupt (if the interrupt is enabled). EN = 0 DMA is halted. The DMA is halted when the byte count reaches zero or transaction time-out occurs. When halted, the DMA updates the byte count, sets NAK = 0 in the output endpoint byte count register, and interrupts the MCU (if bit 6 (INE) = 1). Setting this bit starts the DMA transfer.
EN = 1
6.1.2 DMACSR1: DMA Control And Status Register (UART Transmit Channel) (Addr:FFE1h)
This register defines the transaction time-out value. In addition, it contains a completion code that reports any errors or a time-out condition.
7 0 R BIT 0 NAME PPKT 6 0 R RESET 0 PPKT = 0 PPKT = 1 No partial-packet condition Partial-packet condition detected. When INE = 0, this bit does not clear bit 7 (EN) in the DMACDR1 register; therefore, the DMAC stays enabled, ready for the next transaction. Clears when MCU writes a 1. Writing a 0 has no effect. 5 0 R 4 0 R 3 0 R FUNCTION Partial packet condition bit. This bit is set by the DMA and cleared by the MCU. 2 0 R 1 0 R 0 PPKT R/C
71
34
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
DMA Controller
6.1.3 DMACDR3: DMA Channel Definition Register (UART Receive Channel) (Addr:FFE4h)
These registers define the EDB number that the DMA uses for data transfer from the UARTS. In addition, these registers define the data transfer direction and selects X or Y as the transaction buffer.
7 EN R/W BIT 20 3 4 NAME E[2:0] T/R XY 6 INE R/W RESET 0 1 0 5 CNT R/W 4 XY R/W 3 T/R R/O 2 E2 R/W FUNCTION Endpoint descriptor pointer. This field points to a set of EDB registers that are used for a given transfer. This bit is always read as 1. This bit must be written as 0 to update the X/Y buffer bit (bit 4 in this register) which must only be performed in burst mode. X/Y buffer select bit. XY = 0 XY = 1 5 CNT 0 Next buffer to transmit/receive is X Next buffer to transmit/receive is Y 1 E1 R/W 0 E0 R/W
DMA continuous transfer control bit. This bit defines the mode of the DMA transfer. This bit must always be written as 1. In this mode, the DMA and UBM alternate between the X- and Y-buffers. The UBM sets bit 4 (XY) and the DMA uses it for the transfer. The DMA alternates between the X-/Y-buffers and continues receiving (to X-/Y-buffer) without MCU intervention. The DMA terminates the transfer and interrupts the MCU, under the following conditions: 1. Transaction time-out expired: DMA updates EDB and interrupts the MCU. UBM transfers the partial packet to the host. 2. UART receiver error condition: DMA updates EDB and does not interrupt the MCU. UBM transfers the partial packet to the host.
INE
DMA interrupt enable/disable bit. This bit enables/disables the interrupt on transfer completion. INE = 0 INE = 1 Interrupt is disabled. In addition, bit 0 (OVRUN) and bit 1 (TXFT) in the DMACSR3 register (see Section 6.1.4) do not clear bit 7 (EN) and the DMAC is not disabled. Enables the EN interrupt. When this bit is set, the DMA interrupts the MCU on a 1-to-0 transition of bit 7 (EN). (When transfer is completed, EN = 0).
EN
DMA channel enable bit. The MCU sets this bit to start the DMA transfer. When transfer completes, or when terminated due to error, this bit is cleared. The 1-to-0 transition of this bit generates an interrupt (if the interrupt is enabled). EN = 0 DMA is halted. The DMA is halted when transaction time-out occurs, or under a UART receiver-error condition. When halted, the DMA updates the byte count and sets NAK = 0 in the input endpoint byte count register. If the termination is due to transaction time-out, then the DMA generates an interrupt. However, if the termination is due to a UART error condition, then the DMA does not generate an interrupt. (The UART generates the interrupt.) Setting this bit starts the DMA transfer.
EN = 1
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
35
DMA Controller
6.1.4 DMACSR3: DMA Control And Status Register (UART Receive Channel) (Addr:FFE5h)
This register defines the transaction time-out value. In addition, it contains a completion code that reports any errors or a time-out condition.
7 TEN R/W BIT 0 NAME OVRUN 6 C4 R/W RESET 0 OVRUN = 0 OVRUN = 1 No overrun condition Overrun condition detected. When IEN = 0, this bit does not clear bit 7 (EN) in the DMACDR register; therefore, the DMAC stays enabled, ready for the next transaction. Clears when the MCU writes a 1. Writing a 0 has no effect. DMA stopped transfer without time-out DMA stopped due to transaction time-out. When IEN = 0, this bit does not clear bit 7 (EN) in the DMACDR3 register (see Section 6.1.3); therefore, the DMAC stays enabled, ready for the next transaction. Clears when the MCU writes a 1. Writing a 0 has no effect. 5 C3 R/W 4 C2 R/W 3 C1 R/W FUNCTION Overrun condition bit. This bit is set by DMA and cleared by the MCU (see Table 62) 2 C0 R/W 1 TXFT R/C 0 OVRUN R/C
TXFT
62
C[4:0]
00000b
This field defines the transaction time-out value in 1-ms increments. This value is loaded to a down counter every time a byte transfer occurs. The down counter is decremented every SOF pulse (1 ms). If the counter decrements to zero, then it sets bit 1 (TXFT) = 1 and halts the DMA transfer. The counter starts counting only when bit 7 (TEN) = 1 and bit 7 (EN) = 1 in the DMACDR3 register and the first byte has been received. 00000 = 0-ms time-out : : 11111 = 31-ms time-out Transaction time-out counter enable/disable bit TEN = 0 TEN = 1 Counter is disabled (does not time-out) Counter is enabled
TEN
6.2
36
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
DMA Controller
2. The DMA transfers data from the UART to the X buffer. When a block of 64 bytes is transferred, the DMA updates the byte count and sets NAK to 0 in the input endpoint byte count register (indicating to the UBM that the X buffer is ready to be transferred to host). The UBM starts X-buffer transfer to host using the byte-count value in the input endpoint byte count register and toggles the X/Y bit. The DMA continues transferring data from a device to Y-buffer. At the end of the block transfer, the DMA updates the byte count and sets NAK to 0 in the input endpoint byte count register (indicating to the UBM that the Y-buffer is ready to be transferred to host). The DMA continues the transfer from the device to host, alternating between X-and Y-buffers without MCU intervention. 3. Transfer termination: As mentioned, the DMA/UBM continues the data transfer, alternating between the X- and Y-buffers. Termination of the transfer can happen under the following conditions: Stop Transfer: The host notifies the MCU (via control-end-point) to stop the transfer. Under this condition, the MCU sets bit 7 (EN) to 0 in the DMACDR register. Partial Packet: The device receiver has no data to be transferred to host. Under this condition, the byte-count value is less than 64 when the transaction timer time-out occurs. When the DMA detects this condition, it sets bit 1 (TXFT) to 1 and bit 0 (OVRUN) to 0 in the DMACSR3 register, updates the byte count and NAK bit in the the input endpoint byte count register, and interrupts the MCU. The UBM transfers the partial packet to host. Buffer Overrun: The host is busy, X- and Y-buffers are full (X-NAK = 0 and Y-NAK = 0), and the DMA cannot write to these buffers. The transaction time-out stops the DMA transfer, the DMA sets bit 1 (TXFT) to 1 and bit 0 (OVRUN) to 1 in the DMACSR3 register, and interrupts the MCU. UART Error Condition: When receiving from a UART, a receiver-error condition stops the DMA and sets bit 1 (TXFT) to 1 and bit 0 (OVRUN) to 0 in the DMACSR3 register, but the EN bit remains set at 1. Therefore, the DMA does not interrupt the MCU. However, the UART generates a status interrupt, notifying the MCU that an error condition has occurred.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
37
DMA Controller
2. The UBM transfers data from host to X-buffer. When a block of 64 bytes is transferred, the UBM updates the byte count and sets NAK to 1 in the output endpoint byte count register (indicating to DMA that the X-buffer is ready to be transferred to the UART). The DMA starts X-buffer transfer using the byte-count value in the output endpoint byte count register. The UBM continues transferring data from host to Y-buffer. At the end of the block transfer, the UBM updates the byte count and sets NAK to 1 in the output endpoint byte count register (indicating to DMA that the Y-buffer is ready to be transferred to device). The DMA continues the transfer from the X-/Y-buffers to the device, alternating between X- and Y-buffers without MCU intervention. 3. Transfer termination: The DMA/UBM continues the data transfer alternating between X- and Y-buffers. The termination of the transfer can happen under the following conditions: Stop Transfer: The host notifies the MCU (via control-end point) to stop the transfer. Under this condition, the MCU sets EN to 0 in the DMACDR1 register. Partial-Packet: UBM receives a partial packet from host. Under this condition, the byte-count value is less than 64. When the DMA detects this condition, it transfers the partial packet to the device, sets PPKT to 1, updates NAK to 0 in the output endpoint byte count register, and interrupts the MCU.
38
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
UART
7
7.1
UART
UART Registers
Table 71 summarizes the UART registers. These registers are used for data I/O, control, and status information. UART setup is done by the MCU. Data transfer is typically performed by the DMAC. However, the MCU can perform data transfer without a DMA; this is useful when debugging the firmware. Table 71. UART Registers Summary
REGISTER ADDRESS FFA0h FFA1h FFA2h FFA3h FFA4h FFA5h FFA6h FFA7h FFA8h FFA9h FFAAh FFABh REGISTER NAME RDR TDR LCR FCRL MCR LSR MSR DLL DLH XON XOFF MASK ACCESS R/O W/O R/W R/W R/W R/O R/O R/W R/W R/W R/W R/W FUNCTION UART receiver data register UART transmitter data register UART line control register UART flow control register UART modem control register UART line status register UART modem status register UART divisor register (low byte) UART divisor register (high byte) UART Xon register UART Xoff register UART interrupt mask register Can control three interrupt sources Can generate an interrupt Can generate an interrupt COMMENTS Can be accessed by MCU or DMA Can be accessed by MCU or DMA
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
39
UART
STP
Specifies whether even or odd parity is generated EPRTY = 0 EPRTY = 1 Odd parity is generated (if bit 3 (PRTY) = 1) Even parity is generated (if PRTY = 1)
FPTY
Selects the forced parity bit FPTY = 0 FPTY = 1 Parity is not forced Parity bit is forced. If bit 4 (EPRTY) = 0, the parity bit is forced to 1
BRK
This bit is the break-control bit BRK = 0 BRK = 1 Normal operation Forces SOUT into break condition (logic 0)
FEN
FIFO enable. This bit disables/enables the FIFO. To reset the FIFO, the MCU clears and then sets this bit. FEN = 0 FEN = 1 The FIFO is cleared and disabled. When disabled, the selected receiver flow control is activated. The FIFO is enabled and it can receive data.
40
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
UART
This bit controls the transmitter Xon-on-any/Xoff flow control TXOA = 0 TXOA = 1 Disable the transmitter Xon-on-any/Xoff flow control Enable the transmitter Xon-on-any/Xoff flow control
CTS
Transmitter CTS flow-control enable bit CTS = 0 CTS = 1 Disables transmitter CTS flow control CTS flow control is enabled, that is, when CTS input terminal is high, transmission is halted; when the CTS terminal is low, transmission resumes. When loopback mode is enabled, this bit must be set if flow control is also required. Disables transmitter DSR flow control DSR flow control is enabled, that is, when DSR input terminal is high, transmission is halted; when the DSR terminal is low, transmission resumes. When loopback mode is enabled, this bit must be set if flow control is also required. Receiver does not attempt to match Xon/Xoff characters Receiver searches for Xon/Xoff characters
DSR
RXOF
This bit controls the receiver Xon/Xoff flow control. RXOF = 0 RXOF = 1
RTS
Receiver RTS flow control enable bit RTS = 0 RTS = 1 Disables receiver RTS flow control Receiver RTS flow control is enabled. RTS output terminal goes high when the receiver FIFO HALT trigger level is reached; it goes low, when the receiver FIFO RESUME receiving trigger level is reached. Disables receiver DTR flow control Receiver DTR flow control is enabled. DTR output terminal goes high when the receiver FIFO HALT trigger level is reached; it goes low, when the receiver FIFO RESUME receiving trigger level is reached.
DTR
485E
RS-485 enable bit. This bit configures the UART to control external RS-485 transceivers. When configured in half-duplex mode (485E = 1), RTS or DTR can be used to enable the RS-485 driver or receiver. See Figure 33. 485E = 0 485E = 1 UART is in normal operation mode (full duplex) The UART is in half duplex RS-485 mode. In this mode, RTS and DTR are active with opposite polarity (when RTS = 0, DTR = 1). When the DMA is ready to transmit, it drives RTS = 1 (and DTR = 0) 2-bit times before the transmission starts. When the DMA terminates the transmission, it drives RTS = 0 (and DTR = 1) after the transmission stops. When 485E is set to 1, bit 4 (DTR) and bit 5 (RTS) in the MCR register (see Section 7.1.6) have no effect. Also, see bit 1 (RCVE) in the MCR register.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
41
UART
NOTES: 9. This is a nonpermissible combination. If used, TXOA and TXOF are cleared. 10. Combination example: Transmitter stops when either CTS or Xoff is detected. Transmitter resumes when both CTS is negated and Xon is detected.
NOTES: 11. Combination example: Both RTS is asserted and Xoff transmitted when the FIFO is full. Both RTS is deasserted and Xon is transmitted when the FIFO is empty. 12. Combination example: Both DTR and RTS are asserted when the FIFO is full. Both DTR and RTS are deasserted when the FIFO is empty.
42
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
UART
RCVE
Receiver enable bit. This bit is valid only when bit 7 (485E) in the FCRL register (see Section 7.1.4) is 1 (RS-485 mode). When 485E = 0, this bit has no effect on the receiver. RCVE = 0 RCVE = 1 When 485E = 1, the UART receiver is disabled when RTS = 1, i.e., when data is being transmitted, the UART receiver is disabled. When 485E = 1, the UART receiver is enabled regardless of the RTS state, i.e., UART receiver is enabled all the time. This mode can detect collisions on the RS-485 bus when received data does not match transmitted data. Normal operation Enable loop-back mode of operation. In this mode the following occur: S S S S S SOUT is set high SIN is disconnected from the receiver input. The transmitter serial output is looped back into the receiver serial input. The four modem-control inputs: CTS, DSR, DCD, and RI/CP are disconnected. DTR, RTS, LRI and LCD are internally connected to the four modem-control inputs, and read in the MSR register (see Section 7.1.8) as described below. Note: the FCRL register (see Section 7.1.4) must be configured to enable bits 2 (CTS) and 3 (DSR) to maintain proper operation with flow control and loop back. S S S S DTR is reflected in MSR register bit 4 (LCTS) RTS is reflected in MSR register bit 5 (LDSR) LRI is reflected in MSR register bit 6 (LRI) LCD is reflected in MSR register bit 7 (LCD)
LOOP
This bit controls the normal-/loop-back mode of operation (see Figure 71). LOOP = 0 LOOP = 1
3 4
RSV DTR
0 0
Reserved This bit controls the state of the DTR output terminal (see Figure 71). This bit has no effect when auto-flow control is used or when bit 7 (485E) = 1 (in the FCRL register, see Section 7.1.4). DTR = 0 DTR = 1 Forces the DTR output terminal to inactive (high) Forces the DTR output terminal to active (low)
RTS
This bit controls the state of the RTS output terminal (see Figure 71). This bit has no effect when auto-flow control is used or when bit 7 (485E) = 1 (in the FCRL register, see Section 7.1.4). RTS = 0 RTS = 1 Forces the RTS output terminal to inactive (high) Forces the RTS output terminal to active (low)
LRI
This bit is used for loop-back mode only. When in loop-back mode, this bit is reflected in bit 6 (LRI) in the MSR register, see Section 7.1.8 (see Figure 71). LRI = 0 LRI = 1 Clears the MSR register bit 6 to 0 Sets the MSR register bit 6 to 1
LCD
This bit is used for loop-back mode only. When in loop-back mode, this bit is reflected in bit 7 (LCD) in the MSR register, see Section 7.1.8 (see Figure 71). LCD = 0 LCD = 1 Clears the MSR register bit 7 to 0 Sets the MSR register bit 7 to 1
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
43
UART
This bit indicates the parity condition of the received byte. If set, it halts the DMA transfer and generates a status interrupt (if enabled). PTE = 0 PTE = 1 No parity error in data received Parity error in data received. Clears when the MCU writes a 1. Writing a 0 has no effect.
FRE
This bit indicates the framing condition of the received byte. If set, it halts the DMA transfer and generates a status interrupt (if enabled). FRE = 0 FRE = 1 No framing error in data received Framing error in data received. Clears when MCU writes a 1. Writing a 0 has no effect.
BRK
This bit indicates the break condition of the received byte. If set, it halts the DMA transfer and generates a status interrupt (if enabled). BRK = 0 BRK = 1 No break condition A break condition in data received was detected. Clears when the MCU writes a 1. Writing a 0 has no effect.
RxF
This bit indicates the condition of the receiver data register. Typically, the MCU does not monitor this bit since data transfer is done by the DMA controller. RxF = 0 RxF = 1 No data in the RDR RDR contains data. Generates Rx interrupt (if enabled).
TxE
This bit indicates the condition of the transmitter data register. Typically, the MCU does not monitor this bit since data transfer is done by the DMA controller. TxE = 0 TxE = 1 TDR is not empty TDR is empty. Generates Tx interrupt (if enabled).
TEMT
This bit indicates the condition of both transmitter data register and shift register is empty. TEMT = 0 TEMT = 1 Either TDR or TSR is not empty Both TDR and TSR are empty
RSV
Reserved = 0
44
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
UART
Device Terminals CTS DSR Bit 4 LCTS Modem Status Register Bit 5 LDSR Bit 6 LRI Bit 7 LCD FCRL Register Setting RI/CP DCD
Bit 4 DTR Modem Control Register Bit 5 RTS Bit 6 LRI Bit 7 LCD Bit 2 LOOP FCRL Register Setting
DTR RTS
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
45
UART
Trailing edge of the ring indicator. This bit indicates that the RI/CP input has changed from low to high. This bit is cleared when the MCU writes a 1 to this bit. Writing a 0 has no effect. TRI = 0 TRI = 1 Indicates no applicable transition on the RI/CP input Indicates that an applicable transition has occurred on the RI/CP input.
CD
This bit indicates that the CD input has changed state. Cleared when the MCU writes a 1 to this bit. Writing a 0 has no effect. CD = 0 CD = 1 Indicates no change in the CD input Indicates that the CD input has changed state since the last time it was read.
LCTS
During loopback, this bit reflects the status of bit 4 (DTR) in the MCR register, see Section 7.1.6 (see Figure 71) LCTS = 0 LCTS = 1 CTS input is high CTS input is low
LDSR
During loop back, this bit reflects the status of bit 5 (RTS) in the MCR register, see Section 7.1.6 (see Figure 71) LDSR = 0 LDSR= 1 DSR input is high DSR input is low
LRI
During loop back, this bit reflects the status of bit 6 (LRI) in the MCR register, see Section 7.1.6 (see Figure 71) LRI = 0 LRI = 1 RI/CP input is high RI/CP input is low
LCD
During loopback, this bit reflects the status of bit 7 (LCD) in the MCR register, see Section 7.1.6 (see Figure 71) LCD = 0 LCD = 0 CD input is high CD input is low
46
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
UART
7.1.10
7.1.11
Baud-Rate Calculation
The following formulas calculate the baud-rate clock and the divisors. The baud-rate clock is derived from the 96-MHz master clock (dividing by 6.5). The table below presents the divisors used to achieve the desired baud rates, together with the associate rounding errors. Baud CLK + 96 MHz + 14.76923077 MHz 6.5 Divisor + 14.76923077 10 6 Desired Baud Rate 16 Table 74. DLL/DLH Values and Resulted Baud Rates
DESIRED BAUD RATE 1 200 2 400 4 800 7 200 9 600 14 400 19 200 38 400 57 600 115 200 230 400 460 800 921 600 DLL/DLH VALUE DECIMAL 769 385 192 128 96 64 48 24 16 8 4 2 1 HEXADECIMAL 0301 0181 00C0 0080 0060 0040 0030 0018 0010 0008 0004 0002 0001 ACTUAL BAUD RATE 1 200.36 2 397.60 4 807.69 7 211.54 9 615.38 14 423.08 19 230.77 38 461.54 57 692.31 115 384.62 230 769.23 461 538.46 923 076.92 ERROR % 0.03 0.01 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16
NOTE: The TUSB3410 does support baud rates lower than 1200 bps, which are not listed due to less interest.
7.1.12
This register contains a value that is compared to the received data stream. Detection of a match interrupts the MCU (only if the interrupt enable bit is set). This value is also used for Xon transmission.
7 D7 R/W BIT 70 NAME D[7:0] 6 D6 R/W RESET 0000 5 D5 R/W 4 D4 R/W 3 D3 R/W 2 D2 R/W FUNCTION Xon value to be compared to the incoming data stream 1 D1 R/W 0 D0 R/W
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
47
UART
7.1.13
This register contains a value that is compared to the received data stream. Detection of a match halts the DMA transfer, and interrupts the MCU (only if the interrupt enable bit is set). This value is also used for Xoff transmission.
7 D7 R/W BIT 70 NAME D[7:0] 6 D6 R/W RESET 0000 5 D5 R/W 4 D4 R/W 3 D3 R/W 2 D2 R/W FUNCTION Xoff value to be compared to the incoming data stream 1 D1 R/W 0 D0 R/W
7.1.14
This bit controls the UART-status interrupt. SIE = 0 SIE = 1 Status interrupt is disabled Status interrupt is enabled
TRI
This bit controls the UART-TxE/RxF interrupts TRI = 0 TRI = 1 TxE/RxF interrupts are disabled TxE/RxF interrupts are enabled
73
RSV
Reserved = 0
7.2
48
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
UART
Receiver Halt on Error or Time-Out 64-Byte Y-Buffer DMA DMACDR3 64-Byte X-Buffer X/Y USB Buffer Manager RTS/DTR = 1 or Xoff Transmitted RTS/DTR = 0 or Xon Transmitted Xoff/Xon CTS/DTR = 1/0 64-Byte Y-Buffer Pause/Run DMA DMACDR1 64-Byte X-Buffer TDR RDR: 32-Byte FIFO 4 8 SIN
Host
SOUT
UART
50
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
8
8.1
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
51
52
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
Interrupts
9
9.1
Interrupts
8052 Interrupt and Status Registers
All 8052 standard, five interrupt sources are preserved. SIE is the standard interrupt-enable register that controls the five interrupt sources. This is also known as IE0 located at S:A8h in the special function register area. All the additional interrupt sources are ORed together to generate EX0. Table 91. 8052 Interrupt Location Map
INTERRUPT SOURCE ES ET1 EX1 ET0 EX0 Reset DESCRIPTION UART interrupt Timer-1 interrupt External interrupt-1 Timer-0 interrupt External interrupt-0 START ADDRESS 0023h 001Bh 0013h 000Bh 0003h 0000h Used for all internal peripherals COMMENTS
ET0
EX1
ET1
ES
5, 6 7
RSV EA
0 0
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
53
Interrupts
54
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
Interrupts
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
55
Interrupts
56
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
I 2C Port
10
I2C Port
I2CSTA: I 2C Status and Control Register (Addr:FFF0h)
This register controls the stop condition for read and write operations. In addition, it provides transmitter and receiver handshake signals with their respective interrupt enable bits.
7 RXF R/O BIT 0 NAME SWR 6 RIE R/W RESET 0 5 ERR R/C 4 1/4 R/W 3 TXE R/O FUNCTION Stop write condition. This bit determines if the I2C controller generates a stop condition when data from the I2CDAO register is transmitted to an external device. SWR = 0 SWR = 1 1 SRD 0 Stop condition is not generated when data from the I2CDAO register is shifted out to an external device. Stop condition is generated when data from the I2CDAO register is shifted out to an external device. 2 TIE R/W 1 SRD R/W 0 SWR R/W
Stop read condition. This bit determines if the I2C controller generates a stop condition when data is received and loaded into the I2CDAI register. SRD = 0 SRD = 1 Stop condition is not generated when data from the SDA line is shifted into the I2CDAI register. Stop condition is generated when data from the SDA line are shifted into the I2CDAI register. Interrupt disable Interrupt enable
TIE
TXE
I2C transmitter empty. This bit indicates that data can be written to the transmitter. It can be used for polling or it can generate an interrupt. TXE = 0 TXE = 1 Transmitter is full. This bit is cleared when the MCU writes a byte to the I2CDAO register. Transmitter is empty. The I2C controller sets this bit when the contents of the I2CDAO register are copied to the SDA shift register.
1/4
Bus speed selection (see Note 13) 1/4 = 0 1/4 = 1 100-kHz bus speed 400-kHz bus speed
ERR
Bus error condition. This bit is set by the hardware when the device does not respond. It is cleared by the MCU. ERR = 0 ERR = 1 No bus error Bus error condition has been detected. Clears when the MCU writes a 1. Writing a 0 has no effect. Interrupt disable Interrupt enable
RIE
I2C
I2C receiver full. This bit indicates that the receiver contains new data. It can be used for polling or it can generate an interrupt. RXF = 0 RXF = 1 Receiver is empty. This bit is cleared when the MCU reads the I2CDAI register. Receiver contains new data. This bit is set by the I2C controller when the received serial data has been loaded into the I2CDAI register.
NOTE 13: The bootcode automatically sets the I2C bus speed to 400 kHz. Only 400-kHz I2C EEPROMs can be used.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
57
I 2C Port
10.1.2
This register holds the device address and the read/write command bit.
7 A6 R/W BIT 0 NAME R/W 6 A5 R/W RESET 0 Read/write command bit R/W = 0 R/W = 1 71 A[6:0] 0h Write operation Read operation 5 A4 R/W 4 A3 R/W 3 A2 R/W 2 A1 R/W FUNCTION 1 A0 R/W 0 R/W R/W
10.1.3
10.1.4
This register holds the data to be transmitted to an external device. Writing to this register starts the transfer on the SDA line.
7 D7 W/O BIT 70 NAME D[7:0] 6 D6 W/O RESET 0 8-bit output data to an I2C device 5 D5 W/O 4 D4 W/O 3 D3 W/O 2 D2 W/O FUNCTION 1 D1 W/O 0 D0 W/O
The MCU clears bit 1 (SRD) within the I2CSTA register. This forces the I2C controller not to generate a stop condition after the contents of the I2CDAI register are received. The MCU clears bit 0 (SWR) within the I2CSTA register. This forces the I2C controller not to generate a stop condition after the contents of the I2CDAO register are transmitted. The MCU writes the device address (bit 0 (R/W) = 0) to the I2CADR register (write operation) The MCU writes the high byte of the EEPROM address into the I2CDAO register (this starts the transfer on the SDA line). Bit 3 (TXE) in the I2CSTA register is automatically cleared (indicates busy) by writing data to the I2CDAO register. The contents of the I2CADR register are transmitted to EEPROM (preceded by start condition on SDA).
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
I 2C Port
The contents of the I2CDAO register are transmitted to EEPROM (EPROM address). Bit 3 (TXE) in the I2CSTA register is set and interrupts the MCU, indicating that the I2CDAO register has been transmitted. A stop condition is not generated.
EPROM [Low Byte] The MCU writes the low byte of the EEPROM address into the I2CDAO register. Bit 3 (TXE) in the I2CSTA register is automatically cleared (indicates busy) by writing to the I2CDAO register. The contents of the I2CDAO register are transmitted to the device (EEPROM address). Bit 3 (TXE) in the I2CSTA register is set and interrupts the MCU, indicating that the I2CDAO register has been transmitted. This completes the dummy write operation. At this point, the EEPROM address is set and the MCU can do either a single- or a sequential-read operation.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
59
I 2C Port
N-Byte Read (31 Bytes) The data from the device is latched into the I2CDAI register (stop condition is not transmitted). Bit 7 (RXF) in the I2CSTA register is set and interrupts the MCU, indicating that data is available. The MCU reads the I2CDAI register. This clears bit 7 (RXF) in the I2CSTA register. This operation repeats 31 times. MCU sets bit 1 (SRD) in the I2STA register to 1. This forces the I2C controller to generate a stop condition after the I2CDAI register contents are received. The data from the device is latched into the I2CDAI register (stop condition is transmitted). Bit 7 (RXF) in the I2CSTA register is set and interrupts the MCU, indicating that data is available. The MCU reads the I2CDAI register. This clears bit 7 (RXF) in the I2CSTA register.
EPROM [DATA]
60
TUSB3410, TUSB3410I
I 2C Port
EPROM [Low Byte] The MCU writes the low byte of the EEPROM address into the I2CDAO register. Bit 3 (TXE) in the I2CSTA register is cleared (indicates busy). The contents of the I2CDAO register are transmitted to the device (EEPROM address). Bit 3 (TXE) in the I2CSTA register is set and interrupts the MCU, indicating that the I2CDAO register contents have been transmitted.
EPROM [DATA]31 Bytes The data to be written to the EEPROM are written by the MCU into the I2CDAO register. Bit 3 (TXE) in the I2CSTA register is cleared (indicates busy). The contents of the I2CDAO register are transmitted to the device (EEPROM data). Bit 3 (TXE) in the I2CSTA register is set and interrupts the MCU, indicating that the I2CDAO register contents have been transmitted. This operation repeats 31 times.
EPROM [DATA]Last Byte The MCU sets bit 0 (SWR) in the I2CSTA register. This forces the I2C controller to generate a stop condition after the contents of the I2CDAO register are transmitted. The MCU writes the last date byte to be written to the EEPROM, into the I2CDAO register. Bit 3 (TXE) in the I2CSTA register is cleared (indicates busy). The contents of the I2CDAO register are transmitted to EEPROM (EEPROM data). Bit 3 (TXE) in the I2CSTA register is set and interrupts the MCU, indicating that the I2CDAO register contents have been transmitted. The I2C controller generates a stop condition after the contents of the I2CDAO register are transmitted.
TUSB3410, TUSB3410I 61
SLLS519HJanuary 2010
I 2C Port
62
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
11
11.1 Introduction
If the descriptor block contains binary firmware, then the bootcode sets the header pointer to the beginning of the binary firmware in the I2C EEPROM. If the descriptor block is end of header, then the bootcode stops searching. Enable global and USB interrupts and set the connection bit to 1. Enable global interrupts by setting bit 7 (EA) within the SIE register (see Section 9.1.1) to 1. Enable all internal peripheral interrupts by setting the EX0 bit within the SIE register to 1. Connect to the USB by setting bit 7 (CONT) within the USBCNTL register (see Section 5.4) to 1. Suspend interrupt The idle bit in the MCU PCON register is set and suspend mode is entered. USB reset wakes up the microcontroller. Resume interrupt Bootcode wakes up and waits for new USB requests. Reset interrupt Call UsbReset() routine. Setup interrupt Bootcode processes the request. USB reboot request Disconnect from the USB by clearing bit 7 (CONT) in the USBCTL register and restart at address 0x0000. Download firmware from I2C EEPROM Disable global interrupts by clearing bit 7 (EA) within the SIE register Load firmware to XDATA space if available. If no firmware is found in an I2C EEPROM, the USB host downloads firmware via output endpoint 1. In the first data packet to output endpoint 1, the USB host driver adds 3 bytes before the application firmware in binary format. These three bytes are the LSB and MSB indicating the firmware size and followed by the arithmetic checksum of the binary firmware. Update the USB configuration and interface number. Release control to application firmware. Either disconnect from the USB or continue responding to USB requests.
Wait for any interrupt events until Get DEVICE DESCIPTOR setup packet arrives.
Application firmware
11.3.1
Device Descriptor
The device descriptor provides the USB version that the device supports, device class, protocol, vendor and product identifications, strings, and number of possible configurations. The operation system (Windows, MAC, or Linux) reads this descriptor to decide which device driver should be used to communicate with this device.
64 TUSB3410, TUSB3410I SLLS519HJanuary 2010
The bootcode uses 0x0451 (Texas Instruments) as the vendor ID and 0x3410 (TUSB3410) as the product ID. It also supports three different strings and one configuration. Table 111 lists the device descriptor. Table 111. Device Descriptor
OFFSET (decimal) 0 1 2 4 5 6 7 8 10 12 14 15 16 17 FIELD bLength bDescriptorType bcdUSB bDeviceClass bDeviceSubClass bDeviceProtocol bMaxPacketSize0 idVendor idProduct bcdDevice iManufacturer iProducct iSerialNumber bNumConfigurations SIZE 1 1 2 1 1 1 1 2 2 2 1 1 1 1 VALUE 0x12 1 0x0110 0xFF 0 0 8 0x0451 0x3410 0x100 1 2 3 1 Size of this descriptor in bytes Device descriptor type USB spec 1.1 Device class is vendorspecific We have no subclasses. We use no protocols. Max. packet size for endpoint zero USBassigned vendor ID = TI TI part number = TUSB3410 Device release number = 1.0 Index of string descriptor describing manufacturer Index of string descriptor describing product Index of string descriptor describing devices serial number Number of possible configurations: DESCRIPTION
11.3.2
Configuration Descriptor
The configuration descriptor provides the number of interfaces supported by this configuration, power configuration, and current consumption. The bootcode declares only one interface running in bus-powered mode. It consumes up to 100 mA at boot time. Table 112 lists the configuration descriptor. Table 112. Configuration Descriptor
OFFSET (decimal) 0 1 2 4 5 6 FIELD bLength bDescriptor Type wTotalLength bNumInterfaces bConfigurationValue iConfiguration SIZE 1 1 2 1 1 1 VALUE 9 2 25 = 9 + 9 + 7 1 1 0 Size of this descriptor in bytes. Configuration descriptor type Total length of data returned for this configuration. Includes the combined length of all descriptors (configuration, interface, endpoint, and class- or vendor-specific) returned for this configuration. Number of interfaces supported by this configuration Value to use as an argument to the SetConfiguration() request to select this configuration. Index of string descriptor describing this configuration. Configuration characteristics D7: Reserved (set to one) D6: Self-powered D5: Remote wakeup is supported D40: Reserved (reset to zero) This device consumes 100 mA. DESCRIPTION
bmAttributes
0x80
bMaxPower
0x32
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
65
11.3.3
Interface Descriptor
The interface descriptor provides the number of endpoints supported by this interface as well as interface class, subclass, and protocol. The bootcode supports only one endpoint and use its own class. Table 113 lists the interface descriptor. Table 113. Interface Descriptor
OFFSET (decimal) 0 1 2 3 4 5 6 7 8 FIELD bLength bDescriptorType bInterfaceNumber bAlternateSetting bNumEndpoints bInterfaceClass bInterfaceSubClass bInterfaceProtocol iInterface SIZE 1 1 1 1 1 1 1 1 1 VALUE 9 4 0 0 1 0xFF 0 0 0 Index of string descriptor describing this interface Size of this descriptor in bytes Interface descriptor type Number of interface. Zero-based value identifying the index in the array of concurrent interfaces supported by this configuration. Value used to select alternate setting for the interface identified in the prior field Number of endpoints used by this interface (excluding endpoint zero). If this value is zero, this interface only uses the default control pipe. The interface class is vendor specific. DESCRIPTION
11.3.4
Endpoint Descriptor
The endpoint descriptor provides the type and size of communication pipe supported by this endpoint. The bootcode supports only one output endpoint with the size of 64 bytes in addition to control endpoint 0 (required by all USB devices). Table 114 lists the endpoint descriptor. Table 114. Output Endpoint1 Descriptor
OFFSET (decimal) 0 1 2 FIELD bLength bDescriptorType bEndpointAddress SIZE 1 1 1 VALUE 7 5 0x01 Size of this descriptor in bytes Endpoint descriptor type Bit 30: The endpoint number Bit 7: Direction 0 = OUT endpoint 1 = IN endpoint Bit 10: Transfer type 10 = Bulk 11 = Interrupt Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. Interval for polling endpoint for data transfers. Expressed in milliseconds. DESCRIPTION
bmAttributes
4 6
wMaxPacketSize bInterval
2 1
64 0
11.3.5
String Descriptor
The string descriptor contains data in the unicode format. It is used to show the manufacturers name, product model, and serial number in human readable format. The bootcode supports three strings. The first string is the manufacturers name. The second string is the product name. The third string is the serial number. Table 115 lists the string descriptor.
66
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
67
11.4.1
Product Signature
The product signature must be stored at the first 2 bytes within the I2C storage device. These 2 bytes must match the product number. The order of these 2 bytes must be the LSB first followed by the MSB. For example, the TUSB3410 is 0x3410. Therefore, the first byte must be 0x10 and the second byte must be 0x34. The TUSB3410 bootcode searches the first 2 bytes of the I2C device. If the first 2 bytes are not 0x10 and 0x34, then the bootcode skips the header processing.
68 TUSB3410, TUSB3410I SLLS519HJanuary 2010
11.4.2
Descriptor Block
Each descriptor block contains a prefix and content. The size of the prefix is always 4 bytes. It contains the data type, size, and checksum for data integrity. The descriptor content contains the corresponding information specified in the prefix. It could be as small as 1 byte or as large as 65535 bytes. The next descriptor immediately follows the previous descriptor. If there are no more descriptors, then an extra byte with a value of zero should be added to indicate the end of header.
11.4.2.1
Descriptor Prefix
The first byte of the descriptor prefix is the data type. This tells the bootcode how to process the data in the descriptor content. The second and third bytes are the size of descriptor content. The second byte is the low byte of the size and the third byte is the high byte. The last byte is the 8-bit arithmetic checksum of descriptor content.
11.4.2.2
Descriptor Content
Information stored in the descriptor content can be the USB information, firmware, or other type of data. The size of the content should be from 1 byte to 65535 bytes.
11.6.1
11.6.2
Table 116 contains the USB device, configuration, and string descriptors for the bootcode. The last byte is zero to indicate the end of header.
1 Binary firmware is loaded when the bootcode receives the first get device descriptor request from host. Downloading the firmware should either continue that request in the data stage or disconnect from the USB and then reconnect to the USB as a new device. 2 The bootcode loads this autoexec binary firmware before it connects to the USB. The firmware should connect to the USB once it is loaded.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
69
1
1 1 1 1 1 1 1 2 1 1 1 1 2 2 2 1 1 1 1 1 1 1 1 1 1 2
32 33 34 35
1 1 1 1
36 37 38 39
1 1 1 1
70
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
49
bmAttributes
0x02
50 52 53 54 55 56 57 58 59 61 62 63 65 67 68 69 71 73 74 75 77 79 81 83
wMaxPacketSize bInterval Data Type Data Size (low byte) Data Size (high byte) Check Sum bLength bDescriptorType wLANGID[0] bLength bDescriptorType bString bLength bDescriptorType bString bLength bDescriptorType bString
2 1 1 1 1 1 1 1 2 1 1 2 2 1 1 2 2 1 1 2 2 2 2
0x0040 0x00 0x05 0x1A 0x00 0x50 0x04 0x03 0x0409 0x06 0x03 T,0x00 I,0x00 0x06 0x03 u,0x00 C,0x00 0x0A 0x03 3,0x00 4,0x00 1,0x00 0,0x00 0x00
Data Type
End of header
11.6.3
If the application requires firmware loaded prior to establishing a USB connection, then the following header can be used. The bootcode loads the firmware and releases control to the firmware directly without connecting to the USB. However, per the USB specification requirement, any USB device should connect to the bus and respond to the host within the first 100 ms. Therefore, if downloading time is more than 100 ms, the USB and header speed descriptor blocks should be added before the autoexec binary firmware. Table 117 shows an example of autoexec binary firmware header.
SLLS519HJanuary 2010 TUSB3410, TUSB3410I 71
1
1 1 1 1 1 0x4567 1
1
1 1 0xYYXX
11.8.1
Reboot
bmRequestType USB_REQ_TYPE_DEVICE | USB_REQ_TYPE_VENDOR | USB_REQ_TYPE_OUT BTC_REBOOT None None None None 01000000b
11.8.2
The force execute firmware command requests the bootcode to execute the downloaded firmware unconditionally.
bmRequestType USB_REQ_TYPE_DEVICE | USB_REQ_TYPE_VENDOR | USB_REQ_TYPE_OUT BTC_FORCE_EXECUTE_FIRMWARE None None None None 01000000b
72
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
11.8.3
11.8.4
The external memory write command tells the bootcode to write data to the specified address.
11.8.5
I 2C Memory Read
The bootcode returns the content of the specified address in I2C EEPROM. In the wValue field, the I2C device number is from 0x00 to 0x07 in the high byte. The memory type is from 0x01 to 0x03 for CAT I to CAT III devices. If bit 7 of bValueL is set, then the bus speed is 400 kHz. This request is also used to set the device number and speed before the I2C write request.
bmRequestType USB_REQ_TYPE_DEVICE | USB_REQ_TYPE_VENDOR | USB_REQ_TYPE_IN BTC_I2C_MEMORY_READ HI: LO: I2C device number Memory type bit[1:0] Speed bit[7] 11000000b
bRequest wValue
0x92 0xXXYY
11.8.6
I 2C Memory Write
bmRequestType USB_REQ_TYPE_DEVICE | USB_REQ_TYPE_VENDOR | USB_REQ_TYPE_OUT BTC_I2C_MEMORY_WRITE HI: should be zero LO: Data Data address None None 01000000b
The I2C memory write command tells the bootcode to write data to the specified address.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
73
11.8.7
The bootcode returns the byte of the specified address within the boot ROM. That is, the binary code of the bootcode.
bmRequestType USB_REQ_TYPE_DEVICE | USB_REQ_TYPE_VENDOR | USB_REQ_TYPE_OUT BTC_INTERNAL_ROM_MEMORY_READ None Data address 1 byte Byte in the specified address 01000000b
For each USB request, the bootcode follows the steps below to ensure proper operation of the hardware. 1. Determine the direction of the request by checking the MSB of the bmRequestType field and set the DIR bit within the USBCTL register accordingly. 2. Decode the command 3. If another setup is pending, then return. Otherwise, serve the request. 4. Check again, if another setup is pending then go to step 2. 5. Clear the interrupt source and then the VECINT register. 6. Exit the interrupt routine.
11.9.1.1
The USB request consist of three types of transfers. They are control-read-with-data-stage, control-writewithout-data-stage, and control-write-with-data-stage transfer. In each transfer, arrows indicate interrupts generated after receiving the setup packet, in or out token. Figure 111 and Figure 112 show the USB data flow and how the hardware and firmware respond to the USB requests. Table 119 and Table 1110 lists the bootcode reposes to the standard USB requests.
74
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
Setup (0)
IN(1)
IN(0)
IN(0/1)
OUT(1)
INT
INT
INT
INT
1.Hardware generates interrupt to MCU. 2.Hardware sets NAK on both the IN and the OUT endpoints. 3.Set DIR bit in USBCTL to indicate the data direction. 4.Decode the setup packet. 5.If another setup packet arrives, abandon this one. 6.Execute appropriate routine per Table 11-9. a) Clear NAK bit in OUT endpoint. b) Copy data to IN endpoint buffer and set byte count.
1.Hardware generates interrupt to MCU. 2.Copy data to IN buffer. 3.Clear the NAK bit. 4.If all data has been sent, stall input endpoint.
Figure 111. Control Read Transfer Table 119. Bootcode Response to Control Read Transfer
CONTROL READ Get status of device Get status of interface Get status of endpoint Get descriptor of device Get descriptor of configuration Get descriptor of string Get descriptor of interface Get descriptor of endpoint Get configuration Get interface ACTION IN BOOTCODE Return power and remote wakeup settings Return 2 bytes of zeros Return endpoint status Return device descriptor Return configuration descriptor Return string descriptor Stall Stall Return bConfiguredNumber value Return bInterfaceNumber value
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
75
Setup (0)
IN(1)
INT
1.Hardware generates interrupt to MCU. 2.Hardware sets NAK on both the IN and the OUT endpoints. 3.Set DIR bit in USBCTL to indicate the data direction. 4.Decode the setup packet. 5.If another setup packet arrives, abandon this one. 6.Execute appropriate routine per Table 1110.
11.9.1.2
The higher-vector number has a higher priority than the lower-vector number. Table 1111 lists all the interrupts and source of interrupts.
76
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
11.9.2
This feature can be used during a firmware upgrade. Once the upgrade is complete, the application firmware disconnects from the USB for at least 200 ms to ensure the operating system has unloaded the device driver. The firmware then enables the watchdog timer (enabled by default after power-on reset) and enters an endless loop without resetting the watchdog timer. Once the watchdog timer times out, it resets the TUSB3410 similar to a power on reset. The bootcode takes control and executes the power-on boot sequence.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
77
78
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
Electrical Specifications
12
Electrical Specifications
Stresses beyond those listed under absolute maximum ratings may cause permanent damage to the device. These are stress ratings only, and functional operation of the device at these or any other conditions beyond those indicated under recommended operating conditions is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability.
SLLS519HJanuary 2010
TUSB3410, TUSB3410I
79
Electrical Specifications
TEST CONDITIONS
MIN
TYP 50%
MAX 100 18 10
UNIT ppm pF pF
cycle
80
TUSB3410, TUSB3410I
SLLS519HJanuary 2010
Application Notes
13
Application Notes
13.2 External Circuit Required for Reliable Bus Powered Suspend Operation
TI has found a potential problem with the action of the SUSPEND output terminal immediately after power on. In some cases the SUSPEND terminal can power up asserted high. When used in a bus powered application this can cause a problem because the VREGEN input is usually connected to the SUSPEND output. This in turn causes the internal 1.8-V voltage regulator to shut down, which means an external crystal may not have time to begin oscillating, thus the device will not initialize itself correctly. TI has determined that using components R2 and D1 (rated to 25 mA) in the circuit shown below can be used as a workaround. Note that R1 and C1 are required components for proper reset operation, unless the reset signal is provided by another means. Note that use of an external oscillator (1.8-V output) versus a crystal would avoid this situation. Self-powered applications would probably not see this problem because the VREGEN input would likely be tied low, enabling the internal 1.8-V regulator at all times.
3.3 V R1 15 k TUSB3410
Application Notes
3.3 V
1.8 V
RESET
1.2 V
PACKAGING INFORMATION
Orderable Device TUSB3410IRHB TUSB3410IRHBG4 TUSB3410IRHBR TUSB3410IRHBRG4 TUSB3410IRHBT TUSB3410IVF TUSB3410IVFG4 TUSB3410RHB TUSB3410RHBG4 TUSB3410RHBR TUSB3410RHBRG4 TUSB3410RHBT TUSB3410VF TUSB3410VFG4
(1)
Status (1) ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE ACTIVE
Package Type QFN QFN QFN QFN QFN LQFP LQFP QFN QFN QFN QFN QFN LQFP LQFP
Package Drawing RHB RHB RHB RHB RHB VF VF RHB RHB RHB RHB RHB VF VF
Pins Package Eco Plan (2) Qty 32 32 32 32 32 32 32 32 32 32 32 32 32 32 73 73 Green (RoHS & no Sb/Br) Green (RoHS & no Sb/Br)
Lead/Ball Finish CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU CU NIPDAU
MSL Peak Temp (3) Level-2-260C-1 YEAR Level-2-260C-1 YEAR Level-2-260C-1 YEAR Level-2-260C-1 YEAR Level-2-260C-1 YEAR Level-3-260C-168 HR Level-3-260C-168 HR Level-2-260C-1 YEAR Level-2-260C-1 YEAR Level-2-260C-1 YEAR Level-2-260C-1 YEAR Level-2-260C-1 YEAR Level-3-260C-168 HR Level-3-260C-168 HR
3000 Green (RoHS & no Sb/Br) 3000 Green (RoHS & no Sb/Br) 250 250 250 73 73 Green (RoHS & no Sb/Br) Green (RoHS & no Sb/Br) Green (RoHS & no Sb/Br) Green (RoHS & no Sb/Br) Green (RoHS & no Sb/Br)
3000 Green (RoHS & no Sb/Br) 3000 Green (RoHS & no Sb/Br) 250 250 250 Green (RoHS & no Sb/Br) Green (RoHS & no Sb/Br) Green (RoHS & no Sb/Br)
The marketing status values are defined as follows: ACTIVE: Product device recommended for new designs. LIFEBUY: TI has announced that the device will be discontinued, and a lifetime-buy period is in effect. NRND: Not recommended for new designs. Device is in production to support existing customers, but TI does not recommend using this part in a new design. PREVIEW: Device has been announced but is not in production. Samples may or may not be available. OBSOLETE: TI has discontinued the production of the device.
(2)
Eco Plan - The planned eco-friendly classification: Pb-Free (RoHS), Pb-Free (RoHS Exempt), or Green (RoHS & no Sb/Br) - please check http://www.ti.com/productcontent for the latest availability information and additional product content details. TBD: The Pb-Free/Green conversion plan has not been defined. Pb-Free (RoHS): TI's terms "Lead-Free" or "Pb-Free" mean semiconductor products that are compatible with the current RoHS requirements for all 6 substances, including the requirement that lead not exceed 0.1% by weight in homogeneous materials. Where designed to be soldered at high temperatures, TI Pb-Free products are suitable for use in specified lead-free processes. Pb-Free (RoHS Exempt): This component has a RoHS exemption for either 1) lead-based flip-chip solder bumps used between the die and package, or 2) lead-based die adhesive used between the die and leadframe. The component is otherwise considered Pb-Free (RoHS compatible) as defined above. Green (RoHS & no Sb/Br): TI defines "Green" to mean Pb-Free (RoHS compatible), and free of Bromine (Br) and Antimony (Sb) based flame retardants (Br or Sb do not exceed 0.1% by weight in homogeneous material)
(3)
MSL, Peak Temp. -- The Moisture Sensitivity Level rating according to the JEDEC industry standard classifications, and peak solder temperature. Important Information and Disclaimer:The information provided on this page represents TI's knowledge and belief as of the date that it is
Addendum-Page 1
provided. TI bases its knowledge and belief on information provided by third parties, and makes no representation or warranty as to the accuracy of such information. Efforts are underway to better integrate information from third parties. TI has taken and continues to take reasonable steps to provide representative and accurate information but may not have conducted destructive testing or chemical analysis on incoming materials and chemicals. TI and TI suppliers consider certain information to be proprietary, and thus CAS numbers and other limited information may not be available for release. In no event shall TI's liability arising out of such information exceed the total purchase price of the TI part(s) at issue in this document sold by TI to Customer on an annual basis. OTHER QUALIFIED VERSIONS OF TUSB3410 : Automotive: TUSB3410-Q1 NOTE: Qualified Version Definitions: Automotive - Q100 devices qualified for high-reliability automotive applications targeting zero defects
Addendum-Page 2
Device
Package Package Pins Type Drawing QFN QFN QFN RHB RHB RHB 32 32 32
SPQ
Reel Reel A0 Diameter Width (mm) (mm) W1 (mm) 330.0 330.0 330.0 12.4 12.4 12.4 5.3 5.3 5.3
Pack Materials-Page 1
Pins 32 32 32
Pack Materials-Page 2
MECHANICAL DATA
MTQF002B JANUARY 1995 REVISED MAY 2000
VF (S-PQFP-G32)
0,80 24 17
0,45 0,25
0,20 M
25
16
32
9 0,13 NOM 1 5,60 TYP 7,20 SQ 6,80 9,20 SQ 8,80 0,05 MIN 0,25 0 7 8
Gage Plane
4040172/D 04/00 NOTES: A. All linear dimensions are in millimeters. B. This drawing is subject to change without notice.
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TIs terms and conditions of sale supplied at the time of order acknowledgment. TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TIs standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed. TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards. TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI. Reproduction of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional restrictions. Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. TI products are not authorized for use in safety-critical applications (such as life support) where a failure of the TI product would reasonably be expected to cause severe personal injury or death, unless officers of the parties have executed an agreement specifically governing such use. Buyers represent that they have all necessary expertise in the safety and regulatory ramifications of their applications, and acknowledge and agree that they are solely responsible for all legal, regulatory and safety-related requirements concerning their products and any use of TI products in such safety-critical applications, notwithstanding any applications-related information or support that may be provided by TI. Further, Buyers must fully indemnify TI and its representatives against any damages arising out of the use of TI products in such safety-critical applications. TI products are neither designed nor intended for use in military/aerospace applications or environments unless the TI products are specifically designated by TI as military-grade or "enhanced plastic." Only products designated by TI as military-grade meet military specifications. Buyers acknowledge and agree that any such use of TI products which TI has not designated as military-grade is solely at the Buyer's risk, and that they are solely responsible for compliance with all legal and regulatory requirements in connection with such use. TI products are neither designed nor intended for use in automotive applications or environments unless the specific TI products are designated by TI as compliant with ISO/TS 16949 requirements. Buyers acknowledge and agree that, if they use any non-designated products in automotive applications, TI will not be responsible for any failure to meet such requirements. Following are URLs where you can obtain information on other Texas Instruments products and application solutions: Products Audio Amplifiers Data Converters DLP Products DSP Clocks and Timers Interface Logic Power Mgmt Microcontrollers RFID RF/IF and ZigBee Solutions www.ti.com/audio amplifier.ti.com dataconverter.ti.com www.dlp.com dsp.ti.com www.ti.com/clocks interface.ti.com logic.ti.com power.ti.com microcontroller.ti.com www.ti-rfid.com www.ti.com/lprf TI E2E Community Home Page e2e.ti.com Applications Communications and Telecom www.ti.com/communications Computers and Peripherals Consumer Electronics Energy and Lighting Industrial Medical Security Space, Avionics and Defense Transportation and Automotive Video and Imaging Wireless www.ti.com/computers www.ti.com/consumer-apps www.ti.com/energy www.ti.com/industrial www.ti.com/medical www.ti.com/security www.ti.com/space-avionics-defense www.ti.com/automotive www.ti.com/video www.ti.com/wireless-apps
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265 Copyright 2011, Texas Instruments Incorporated