Académique Documents
Professionnel Documents
Culture Documents
User's Manual
Rev. 1.0
Table of Contents
1 TWR-K40X256 and TWR-K40X256-KIT Overview ......................................................................4
1.1 Contents .................................................................................................................................................................................. 5 1.2 Features .................................................................................................................................................................................. 5 1.3 Getting Started ..................................................................................................................................................................... 7 1.4 Reference Documents ....................................................................................................................................................... 7 2.1 K40X256 Microcontroller ............................................................................................................................................... 8 2.2 Clocking .................................................................................................................................................................................. 9 2.3 System Power .................................................................................................................................................................... 10 2.4 Debug Interface ................................................................................................................................................................ 10 2.5 Infrared Port ...................................................................................................................................................................... 11 2.6 Accelerometer ................................................................................................................................................................... 12 2.7 Potentiometer, Pushbuttons, LEDs .......................................................................................................................... 12 2.8 General Purpose Tower Plug-in (TWRPI) Socket............................................................................................... 12 2.9 Touch Interface................................................................................................................................................................. 13 2.10 Segment LCD ................................................................................................................................................................... 14 2.11 USB ...................................................................................................................................................................................... 14 2.12 Secure Digital Card Slot .............................................................................................................................................. 14 2.13 External Bus Interface FlexBus ............................................................................................................................ 15
2.3.1 RTC VBAT ........................................................................................................................................................................................... 10 2.4.1 OSJTAG ................................................................................................................................................................................................. 10 2.4.2 Cortex Debug+ETM Connector .................................................................................................................................................. 11
3 Jumper Table.......................................................................................................................................... 15 4 Input/Output Connectors and Pin Usage Table ......................................................................... 16 5 Tower Elevator Connections ............................................................................................................ 18
Page 2 of 21
List of Figures
Figure 1. Freescale Tower System Overview .............................................................................................. 4 Figure 2. Callouts on front side of the TWR-K40X256 ................................................................................ 6 Figure 3. Front side of TWR-K40X256 with TWRPI-SLCD attached............................................................. 6 Figure 4. Callouts on back side of the TWR-K40X256 ................................................................................. 7 Figure 5. TWR-K40X256 Block Diagram ...................................................................................................... 8 Figure 6. External clock source circuitry ..................................................................................................... 9 Figure 7. Infrared Port Implementation ................................................................................................... 12 Figure 8. Flexbus Connections for External Memory Port Sizes (CSCRn[BLS] = 1) ................................... 15
List of Tables
Table 1. MCG oscillator input selection resistor settings ......................................................................... 10 Table 2. Cortex Debug+ETM Connector Pinout ........................................................................................ 11 Table 3. General Purpose TWRPI socket pinout ....................................................................................... 13 Table 4. Touch TWRPI socket pinout ........................................................................................................ 13 Table 5. TWR-K40X256 Jumper Table ....................................................................................................... 15 Table 6. I/O Connectors and Pin Usage Table........................................................................................... 16 Table 7. TWR-K40X256 Primary Connector Pinout................................................................................... 18 Table 8. TWR-K40X256 Secondary Connector Pinout .............................................................................. 19
Revision History
Revision 1.0 Date Nov 9, 2010 Changes Initial Release for PWA 700-26547 Rev A
Page 3 of 21
Page 4 of 21
1.1 Contents
The TWR-K40X256 contents include: TWR-K40X256 board assembly Segment LCD Tower Plug-in module, TWRPI-SLCD 3ft USB cable Interactive DVD with software installers and documentation Quick Start Guide The TWR-K40X256-KIT contains: TWR-K40X256 MCU module TWR-ELEV Primary and Secondary Elevator Modules TWR-SER Serial module including USB host/device/OTG, Ethernet, CAN, RS232 and RS485
1.2 Features
Figure 2, Figure 3 and Figure 4 show the TWR-K40X256 with some of the key features called out. The following list summarizes the features of the TWR-K40X256 Tower MCU Module: Tower compatible microcontroller module MK40X256VMD100: K40X256 in a 144 MAPBGA with 100MHz operation Touch and Segment LCD Tower Plug-in Socket Segment LCD Tower Plug-in module, TWRPI-SLCD General purpose Tower Plug-in (TWRPI) socket On-board JTAG debug circuit (OSJTAG) with virtual serial port Three axis accelerometer (MMA7660) Four (4) user-controllable LEDs Four (4) capacitive touch pads Two (2) user pushbutton switches Potentiometer Battery Holder for 20mm lithium battery (e.g. 2032, 2025) SD Card slot
Page 5 of 21
Page 6 of 21
2 Hardware Description
The TWR-K40X256 is a Tower Controller Module featuring the MK40X256VMD100an ARM CortexM4 based microcontroller with segment LCD and USB 2.0 full-speed OTG controllers in a 144 MAPBGA package with a maximum core operating frequency of 100MHz. It is intended for use in the Freescale Tower System but can operate stand-alone. An on-board debug circuit, OSJTAG, provides a JTAG debug interface and a power supply input through a single USB mini-AB connector. Figure 5 shows a block diagram of the TWR-K40X256. The following sections describe the hardware in more detail.
Page 7 of 21
5.0V
Tower Elevator Expansion Connectors SDHC, I2S, SPI, I2C, ADC, USB, DAC, PWM, UARTs, Flexbus, Segment LCD 8 MHz XTAL 32.768 KHz XTAL
3.3V
IR Output Comparator
Infrared Port
GPIO / Interrupts
LED LED
LED LED
TSI, GPIO
SD Card Slot
ADC
MMA7660
Freescale Device
External Connectors
Interface Circuits
Power
USB full-speed/low-speed OTG/Host/Device controller with device charge detect SPI, I2C (w/ SMBUS support), UART (w/ ISO7816 and IrDA), CAN, I2S SD Host Controller (SDHC) GPIO with pin interrupt support, DMA request capability, digital glitch filtering Capacitive touch sensing inputs (TSI) LCD display driver supporting 3V and 5V glass, configurable frontplane and backplane pins, and segment failure detection Debug interfaces: JTAG, cJTAG, SWD Trace: TPIO, FPB, DWT, ITM, ETM, ETB
2.2 Clocking
The Kinetis MCUs start up from an internal digitally controlled oscillator (DCO). Software can enable one or two external oscillators if desired. The external oscillator for the Multipurpose Clock Generator (MCG) module can range from 32.768 KHz up to a 32 MHz crystal or ceramic resonator. The external oscillator for the Real Time Clock (RTC) module accepts a 32.768 kHz crystal.
DNP
C31
18PF
32KHz_XTL
0 0 DNP
XTAL32_RTC
Y3 32.768KHz
R91
DNP
C37
18PF
32KHz_EXTL
0 0
EXTAL32_RTC
R88 0
XTAL_MAIN
1
2 X3 8.00MHZ
8MHz_EXTL
CLKIN0
R84 DNP
Figure 6. External clock source circuitry The clocking circuitry on the TWR-K40X256 is shown on sheet 4 of the schematics and in Figure 6. An 8.0 MHz ceramic resonator with built-in load capacitors is the default external source for the MCG oscillator inputs (XTAL/EXTAL_MAIN). A 32.768 KHz crystal is connected to the RTC oscillator inputs by default. There are optional resistors (not populated by default) to allow for the MCG oscillator inputs to be routed from any one of the 8.0 MHz resonator, the 32.678 KHz crystal, or the clock input pin CLKIN0 from the Primary Connector (pin B24). Table 1 shows the resistor settings for each of the MCG oscillator input options.
Page 9 of 21
Page 10 of 21
2.4.2 Cortex Debug+ETM Connector The Cortex Debug+ETM connector is a 20-pin (0.05") connector providing access to the SWD, SWV, JTAG, cJTAG, EzPort and ETM trace (4-bit) signals available on the K40 device. The pinout and K40 pin connections to the debug connector, J14, is shown in Table 2Table 2. Table 2. Cortex Debug+ETM Connector Pinout
Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Function VTref TMS / SWDIO GND TCK / SWCLK GND TDO / SWO Key TDI GNDDetect nRESET Target Power TRACECLK Target Power TRACEDATA[0] GND TRACEDATA[1] GND TRACEDATA[2] GND TRACEDATA[3] TWR-K40X256 Connection 3.3V MCU supply (P3V3_MCU) PTA3/SCI0_RTS_b/FTM0_CH0/JTAG_MS/SWD_DIO GND PTA0/SCI0_CTS_b/FTM0_CH5/JTAG_CLK/SWD_CLK/EZP_CLK GND PTA2/SCI0_TX/FTM0_CH7/JTAG_DO/TRACE_SWO/EZP_DO PTA1/SCI0_RX/FTM0_CH6/JTAG_DI/EZP_DI PTA4/FTM0_CH1/MS/NMI_b/EZP_CS_b RESET_b 5V supply (via J15) PTA6/FTM0_CH3/FB_CLKOUT/TRACE_CLKOUT 5V supply (via J15) PTA10/FTM2_CH0/FB_AD15/FTM2_QD_PHA/TRACE_D0 GND PTA9/FTM1_CH1/FB_AD16/FTM1_QD_PHB/TRACE_D1 GND PTA8/FTM1_CH0/FB_AD17/FTM1_QD_PHA/TRACE_D2 GND PTA7/FTM0_CH4/FB_AD18/TRACE_D3
Note: Many of the trace signals connected to the debug connector are also connected elsewhere on the TWR-K40X256. Refer to Table 6 I/O Connectors and Pin Usage Table and Table 7 TWR-K40X256 Primary Connector Pinout for more information.
Page 11 of 21
P3V3
CMP0_IN0 1.0K
PTC6
Q3 QTLP610CPD
1
C5 0.1UF
2 1
PTD7
CMT_IRO
IRDAJ
D3
R23 1 IRDAR 33
Figure 7. Infrared Port Implementation Note: The port pins connected to the infrared interface (PTD6 and PTD7) are also connected to the OSJTAG USB-to-serial bridge. Refer to Table 6 I/O Connectors and Pin Usage Table and Table 5 TWR-K40X256 Jumper Table for more information.
2.6 Accelerometer
An MMA7660 digital accelerometer is connected to the K40 MCU through an I2C interface and a GPIO/IRQ signal. Refer to Table 6 I/O Connectors and Pin Usage Table for connection details.
Page 12 of 21
Page 13 of 21
Pin 8 9 10 11 12 13 14 15 16 17 18 19 20
Description Electrode 3 Electrode 4 Electrode 5 Electrode 6 Electrode 7 Electrode 8 Electrode 9 Electrode 10 Electrode 11 ADC: TWRPI ID 0 ADC: TWRPI ID 1 GND Reset
2.11 USB
The K40X256 features a USB full-speed/low-speed OTG/Host/Device controller with built-in transceiver. The TWR-K40X256 routes the USB D+ and D- signals from the K40 MCU to the Primary Connector, allowing the connection to USB connectors or additional circuitry on a Tower peripheral module. The TWR-SER module included as part of the TWR-K40X256-KIT provides a USB OTG/Host/Device interface with a mini-AB USB connector. There are many configuration options that can be selected to evaluate different USB modes of operation. By default, the TWR-SER is configured for USB Device operation. Please refer to the documentation included with the TWR-SER for more information on the configuration options.
Page 14 of 21
3 Jumper Table
There are several jumpers on the TWR-K40X256 that provide configuration selection and signal isolation. Refer to the following table for details. The default installed jumper settings are shown in bold with asterisks. Table 5. TWR-K40X256 Jumper Table
Jumper
J3 J5 J6 J11
Option
USB VREGIN Power Connection Flexbus Address Latch Selection Infrared Transmitter Connection MCU Power Connection
Setting
*ON* OFF 1-2 *2-3* ON *OFF* *ON*
Description
Connect USB0_VBUS from Primary Elevator (A57) to VREGIN Disconnect VREGIN from Primary Elevator Flexbus address latch disabled Flexbus address latch enabled Connect PTD7/CMT_IRO/UART0_TX to IR Transmitter (D3) Disconnect PTD7/CMT_IRO/UART0_TX from IR Transmitter (D3) Connect on-board 3.3V supply to MCU
Page 15 of 21
J13
Isolate MCU from power supply (allows for external supply or power measurements) Connect VBAT to on-board 3.3V supply Connect VBAT to the higher voltage between on-board 3.3V supply or coin-cell supply OSJTAG bootloader mode (OSJTAG firmware reprogramming)
Debugger mode
Connect on-board 5V supply to JTAG port (supports powering board from external JTAG probe) Disconnect on-board 5V supply from JTAG port
J15
SD Card Slot
Infrared Port
Pushbuttons
Touch Pads
LEDs
Page 16 of 21
Potentiometer
Accelerometer
E3 / Green LED E4 / Blue LED Potentiometer (R71) SSI Header (J4 Pin 1) SSI Header (J4 Pin 2) SSI Header (J4 Pin 3) SSI Header (J4 Pin 4) SSI Header (J4 Pin 5) SSI Header (J4 Pin 6) SSI Header (J4 Pin 7) I2C SDA I2C SCL IRQ TWRPI AN0 (J8 Pin 8) TWRPI AN1 (J8 Pin 9) TWRPI AN2 (J8 Pin 12) TWRPI ID0 (J8 Pin 17) TWRPI ID1 (J8 Pin 18) TWRPI I2C SCL (J9 Pin 3) TWRPI I2C SDA (J9 Pin 4) TWRPI SPI MISO (J9 Pin 9) TWRPI SPI MOSI (J9 Pin 10) TWRPI SPI SS (J9 Pin 11) TWRPI SPI CLK (J9 Pin 12) TWRPI GPIO0 (J9 Pin 15) TWRPI GPIO1 (J9 Pin 16) TWRPI GPIO2 (J9 Pin 17) TWRPI GPIO3 (J9 Pin 18) TWRPI GPIO4 (J9 Pin 19) Electrode 0 (J7 Pin 3) Electrode 1 (J7 Pin 5) Electrode 2 (J7 Pin 7) Electrode 3 (J7 Pin 8) Electrode 4 (J7 Pin 9) Electrode 5 (J7 Pin 10) Electrode 6 (J7 Pin 11) Electrode 7 (J7 Pin 12) Electrode 8 (J7 Pin 13) Electrode 9 (J7 Pin 14) Electrode 10 (J7 Pin 15) Electrode 11 (J7 Pin 16) TWRPI ID0 (J7 Pin 17)
PTC9 PTB11 PTA16 PTA13 PTA12 PTA15 PTA5 PTA14 PTA17 PTC11 PTC10 PTC12 PTC10 PTC11 PTB23 PTB22 PTB20 PTB21 PTC12 PTB9 PTB10 PTC5 PTA5 PTB0 PTB1 PTB2 PTB3 PTC0 PTC1 PTC2 PTA4 PTB16 PTB17 PTB18 PTB19
PTC9 PTB11 ADC1_DM1 SSI0_RX_FS SSI0_TX_FS SSI0_TXD SSI0_RXD SSI_RX_BCLK SSI0_TX_BCLK SSI0_MCLK/SSI0_CLKIN I2C1_SDA I2C1_SCL PTC12 ADC0_DP0/ADC1_DP3 ADC0_DM0/ADC1_DM3 ADC1_DP0/ADC0_DP3 ADC0_DP1 ADC0_DM1 I2C1_SCL I2C1_SDA SPI2_SIN SPI2_SOUT SPI2_PCS0 SPI2_SCK PTC12 PTB9 PTB10 PTC5 PTA5 TSI0_CH0 / LCD_P0 TSI0_CH6 / LCD_P1 TSI0_CH7 / LCD_P2 TSI0_CH8 / LCD_P3 TSI0_CH13 / LCD_P20 TSI0_CH14 / LCD_P21 TSI0_CH15 / LCD_P22 TSI0_CH5 TSI0_CH9 / LCD_P12 TSI0_CH10 / LCD_P13 TSI0_CH11 / LCD_P14 TSI0_CH12 / LCD_P15 ADC1_DP1
Page 17 of 21
ADC1_DM0/ADC0_DM3
PTC18 PTE0 PTE28 PTA18 PTE26 Ground PTB0 PTB1 PTB2 PTB3 Ground DAC1_OUT PTC5 PTD6 PTB9 3.3V Power PTA2 PTA1 PTD5 PTD4 PTE25 PTE24
PTA17 PTA14 PTA13 PTA15 PTA12 Ground PGA0_DP/ADC0_DP0/ADC1_DP3 PGA0_DM/ADC0_DM0/ADC1_DM3 PGA1_DP/ADC1_DP0/ADC0_DP3 PGA1_DM/ADC1_DM0/ADC0_DM3 Ground DAC0_OUT PTA9 PTA8 PTB10 3.3V Power PTC4 PTC3 PTC2 PTC1 PTC14 PTC15 PTC16
Page 18 of 21
Pin # B44 B45 B46 B47 B48 B49 B50 B51 B52 B53 B54 B55 B56 B57 B58 B59 B60 B61 B62 B63 B64 B65 B66 B67 B68 B69 B70 B71 B72 B73 B74 B75 B76 B77 B78 B79 B80 B81 B82
Side B Name Usage SPI0_MISO PTD3 SPI0_MOSI PTD2 SPI0_CS0_b PTD0 SPI0_CS1_b PTC3 SPI0_CLK PTD1 GND Ground SCL1 PTB2 SDA1 PTB3 GPIO5 / SD_CARD_DET PTA16 USB0_DP_PDOWN USB0_DM_PDOWN IRQ_H PTB5 IRQ_G PTB5 IRQ_F PTB6 IRQ_E PTB6 IRQ_D PTB7 IRQ_C PTB7 IRQ_B PTB8 IRQ_A PTB8 EBI_ALE / EBI_CS1_b PTE6 EBI_CS0_b PTE7 GND Ground PTA10 EBI_AD15 PTA9 EBI_AD16 PTA8 EBI_AD17 PTA7 EBI_AD18 EBI_AD19 PTA29 EBI_R/W_b PTD15 EBI_OE_b PTA11 EBI_D7 PTD12 EBI_D6 PTD13 EBI_D5 PTD14 EBI_D4 PTE8 EBI_D3 PTE9 EBI_D2 PTE10 EBI_D1 PTE11 EBI_D0 PTE12 GND Ground 3.3V 3.3V Power
Pin # A44 A45 A46 A47 A48 A49 A50 A51 A52 A53 A54 A55 A56 A57 A58 A59 A60 A61 A62 A63 A64 A65 A66 A67 A68 A69 A70 A71 A72 A73 A74 A75 A76 A77 A78 A79 A80 A81 A82
Side A Name TXD1 VSS VDDA VREFA1 VREFA2 GND GPIO14 GPIO15 GPIO16 GPIO17 USB0_DM USB0_DP USB0_ID USB0_VBUS TMR7 TMR6 TMR5 TMR4 RSTIN_b RSTOUT_b CLKOUT0 GND EBI_AD14 EBI_AD13 EBI_AD12 EBI_AD11 EBI_AD10 EBI_AD9 EBI_AD8 EBI_AD7 EBI_AD6 EBI_AD5 EBI_AD4 EBI_AD3 EBI_AD2 EBI_AD1 EBI_AD0 GND 3.3V Usage PTC17 VSSA VDDA VREFH VREFL Ground
RESET_b RESET_b PTA6 Ground PTA24 PTA25 PTA26 PTA27 PTA28 PTA29 PTD11 LATCH_FBA7 LATCH_FBA6 LATCH_FBA5 LATCH_FBA4 LATCH_FBA3 LATCH_FBA2 LATCH_FBA1 LATCH_FBA0 Ground 3.3V Power
Page 19 of 21
Pin # D14 D15 D16 D17 D18 D19 D20 D21 D22 D23 D24 D25 D26 D27 D28 D29 D30 D31 D32 D33 D34 D35 D36 D37 D38 D39 D40 D41 D42 D43 D44 D45 D46 D47 D48 D49 D50 D51 D52 D53 D54 D55 D56 D57 D58 D59 D60 D61 D62 D63 D64 D65 D66 D67 D68 D69 D70 D71
Side D Name Usage ETH_TXCLK ETH_TXEN GPIO18 GPIO19 / SDHC_D4 GPIO20 / SDHC_D5 ETH_TXD1 ETH_TXD0 ULPI_NEXT / USB1_DM ULPI_DIR / USB1_DP UPLI_DATA5 / USB2_DM ULPI_DATA6 / USB2_DP ULPI_DATA7 GND Ground LCD_HSYNC / LCD_P24 PTB9 LCD_VSYNC / LCD_P25 PTB10 AN13 AN12 GND Ground LCD_CLK / LCD_P26 PTB11 TMR11 TMR10 GPIO21 3.3V 3.3V Power PWM15 PWM14 PWM13 PWM12 CANRX1 CANTX1 GPIO22 LCD_OE / LCD_P27 PTB20 LCD_D0 / LCD_P0 PTC16 LCD_D1 / LCD_P1 PTC17 LCD_D2 / LCD_P2 PTC18 LCD_D3 / LCD_P3 PTC19 GND Ground GPIO23 GPIO24 LCD_D12 / LCD_P12 PTC7 LCD_D13 / LCD_P13 PTC8 LCD_D14 / LCD_P14 PTC9 IRQ_P / SPI2_CS2_b IRQ_O / SPI2_CS3_b IRQ_N IRQ_M IRQ_L IRQ_K IRQ_J IRQ_I LCD_D18 / LCD_P18 PTC15 LCD_D19 / LCD_P19 PTB5 GND Ground EBI_AD20 / LCD_P42 EBI_AD21 / LCD_P43 EBI_AD22 / LCD_P44 EBI_AD23 / LCD_P45 EBI_AD24 / LCD_P46 EBI_AD25 / LCD_P47
Pin # C14 C15 C16 C17 C18 C19 C20 C21 C22 C23 C24 C25 C26 C27 C28 C29 C30 C31 C32 C33 C34 C35 C36 C37 C38 C39 C40 C41 C42 C43 C44 C45 C46 C47 C48 C49 C50 C51 C52 C53 C54 C55 C56 C57 C58 C59 C60 C61 C62 C63 C64 C65 C66 C67 C68 C69 C70 C71
Side C Name ETH_MDIO ETH_RXCLK ETH_RXDV GPIO27 / SDHC_D6 GPIO28 / SDHC_D7 ETH_RXD1 ETH_RXD0 ULPI_DATA0 / USB3_DM ULPI_DATA1 / USB3_DP ULPI_DATA2 / USB4_DM ULPI_DATA3 / USB4_DP ULPI_DATA4 GND AN11 AN10 AN9 AN8 GND GPIO29 TMR9 TMR8 GPIO30 3.3V PWM11 PWM10 PWM9 PWM8 RXD2 / TSI0 TXD2 / TSI1 RTS2 / TSI2 CTS2 / TSI3 RXD3 / TSI4 TXD3 / TSI5 RTS3 / TSI6 CTS3 / TSI7 GND LCD_D4 / LCD_P4 LCD_D5 / LCD_P5 LCD_D6 / LCD_P6 LCD_D7 / LCD_P7 LCD_D8 / LCD_P8 LCD_D9 / LCD_P9 LCD_D10 / LCD_P10 LCD_D11 / LCD_P11 TMR16 TMR15 TMR14 TMR13 LCD_D15 / LCD_P15 LCD_D16 / LCD_P16 LCD_D17 / LCD_P17 GND EBI_BE_32_24_b / LCD_P28 EBI_BE_23_16_b / LCD_P29 EBI_BE_15_8_b / LCD_P30 EBI_BE_7_0_b / LCD_P31 EBI_TSIZE0 / LCD_P32 EBI_TSIZE1 / LCD_P33
Usage
Ground
Ground
3.3V Power
PTC12 PTC13 PTC14 Ground PTB21 PTB22 PTB23 PTC3 PTC10 PTC11
Page 20 of 21
Pin # D72 D73 D74 D75 D76 D77 D78 D79 D80 D81 D82
Side D Name EBI_AD26 / LCD_P48 EBI_AD27 / LCD_P49 EBI_AD28 / LCD_P50 EBI_AD29 / LCD_P51 EBI_AD30 / LCD_P52 EBI_AD31 / LCD_P53 LCD_D20 / LCD_P20 LCD_D21 / LCD_P21 LCD_D22 / LCD_P22 GND 3.3V Usage
Pin # C72 C73 C74 C75 C76 C77 C78 C79 C80 C81 C82
Side C Name EBI_TS_b / LCD_P34 EBI_TBST_b / LCD_P35 EBI_TA_b / LCD_P36 EBI_CS4_b / LCD_P37 EBI_CS3_b / LCD_P38 EBI_CS2_b / LCD_P39 EBI_CS1_b / LCD_P40 GPIO31 / LCD_P41 LCD_D23 / LCD_P23 GND 3.3V
Usage
Page 21 of 21