MCBTWRK60 User's Guide: MCBTWRK60 User's Guide

Keil, An ARM® Company MCBTWRK60 User's Guide

The MCBTWRK60 User's Guide describes the MCBTWRK60 Tower System and contains detailed operating instructions for the hardware.

  • Introduction gives an overview of the MCBTWRK60 Tower System, hardware and software requirements, where to find information quickly, and where to find Technical Support.
  • Setup shows the MCBTWRK60 Tower System components, how to connect, configure, and use the board, and describes the jumpers.
  • Theory of Operation explains the components of the MCBTWRK60 Tower System in detail.
  • Writing Programs describes how to write programs, download to flash, and configure your project for debugging for the MCBTWRK60 Tower System.
  • Example Programs lists example programs available on the installation CD. There are step-by-step instructions on building and running programs on the MCBTWRK60 Tower System.

Revision History

  • June 2011: Initial release.

Copyright © Keil, An ARM Company. All rights reserved.


MCBTWRK60 User's Guide: Debugging with ULINK

Debugging with ULINK

Detailed information can be found in the µVision User's Guide in the Debugging topic and in the Getting Started User's Guide (..\Keil\ARM\HLP\GSA.CHM) in the chapter Testing Programs.

Follow these steps to start debugging using the µVision Debugger and the ULINK USB_JTAG Adapter.

  1. Connect the ULINK to the JTAG connector of the MCBTWRK60 Tower System.
    Note that the red cable marks pin 1 of the JTAG-connector.

    MCBTWRK60 Tower System Connected to ULINK2

    Note

    • The CoreSight debug port in the Kinetis core is disabled when the device is in Power Down or Idle mode. ULINK stops working if your code puts the ARM device into Idle or Power Down mode. Therefore, do not enable either of the power saving modes of the Kinetis K60 during the software development cycle in your application program.
  2. Power up the MCBTWRK60 Tower System.
  3. Configure the Debugger in the Project — Options for Target — Debug dialog.

    Options for Target Button Use the Options for Target toolbar button and click the Debug tab to display the Debug dialog.

    For ULINK2 and ULINK-ME:
    Use: ULINK ARM Debugger Select the Use: radio button and then ULINK Cortex Debugger in the drop-down list to choose the ULINK2 or ULINK-ME USB-JTAG Adapter as the debugging tool.

    For ULINKpro:
    Use: ULINK ARM Debugger Select the Use: radio button and then ULINK Pro Cortex Debugger in the drop-down list to choose the ULINKpro USB-JTAG Adapter as the debugging tool.

    Use: ULINK ARM Debugger Check the Load Application at Startup and the Run to main() options to load your application and execute code up to the beginning of your main() function when the debugger starts.

  4. Click the Settings button to open the ARM Target Driver Setup dialog.

    This dialog displays the IDCODE of the ARM device on the MCBTWRK60 Tower System.

    Options for Target - Debug - Settings - JTAG Device Display

  5. Debug Options To ensure that the TWR-K60N512 board initializes properly when you start the debugger, in the Connect & Reset Options section, verify that the Connect: option is set to under Reset, the Reset: option is set to HW RESET, and the Reset after Connect check box option is checked as shown.

  6. Download Options Select the Verify Code Download option under Download Options to compare the loaded application program with the Flash ROM content. You may disable this option to speed up the debugger start.

  7. Click OK, then OK again to save any changes you might have made.
  8. Start the Debugger.

    Start/Stop Debug Button Use the Start/Stop Debug Session toolbar button to start debugging the program.

    Or

    Use the µVision command, Debug — Start/Stop Debug Session, to start debugging the program.


MCBTWRK60 User's Guide: Debugging Programs

Debugging Programs

µVision IDE offers a very powerful and comprehensive set of debugging tools designed to make program testing easier and reduce the time it takes to produce a working application.

Using the µVision debugger and the embedded ICE capability of the MCBTWRK60, you may set breakpoints and step through your code, and also view the status of on-chip peripherals using the Peripheral dialogs custom-designed for the Kinetis Kxx device.

The required steps for configuring the debugger on the MCBTWRK60 board are described in the topic Debugging with ULINK.


MCBTWRK60 User's Guide: BLINKY

BLINKY

The BLINKY example program toggles the LEDs on the MCBTWRK60.

The BLINKY example project demonstrates assembling, compiling, linking, downloading, and debugging using the µVision IDE on the MCBTWRK60 board. The on-board LEDs make it easy to visually verify that the program loads and executes properly.

Loading BLINKY

To load the BLINKY project, select Open Project from the Project menu and open BLINKY.UV2 from the \KEIL\ARM\BOARDS\FREESCALE\TWR-K60N512\BLINKY\ folder.

Select Project File Dialog

Project Workspace When the BLINKY project opens, the µVision Project Workspace window displays the source files that make up the project.

  • Startup_MK60N512MD100.s contains the CPU startup code for the Freescale Kinetis Kxx devices.
  • System_MK60N512MD100.c configures and initializes the target-dependent peripherals.
  • Blinky.c contains the application module that monitors analog input, and toggles the LEDs.

The Abstract.txt file contains documentation about the project.

Editing BLINKY

You may edit Blinky.c or review the source code. Double click on Blinky.c in the Files page of the Project Workspace window. µVision loads and displays the contents of Blinky.c in an editor window.

Running BLINKY

Perform the following four steps to run the BLINKY Example on the MCBTWRK60 Tower System:

  1. Building BLINKY
  2. Downloading BLINKY
  3. Debugging BLINKY
  4. Checking Program Output


MCBTWRK60 User's Guide: Building BLINKY

Building BLINKY

Build the BLINKY example program following this procedure. The executable files are placed in an output folder, ready for downloading.

Build Target Button When you are ready to compile and link your project, use the Build Target command from the Project menu or the Build toolbar.

µVision translates and links the source files and creates an absolute object module that you may load into the µVision debugger for testing. The status of the build process displays in the Build page of the Output Window.

Note

  • The sample projects provided with µVision compile and link without errors.


MCBTWRK60 User's Guide: Debugging BLINKY

Debugging BLINKY

Debug the BLINKY example program following this procedure. The debugged program is ready for the serial output check.

Start/Stop Debug Button Use the Start/Stop Debug Session toolbar button or the µVision command Debug — Start/Stop Debug Session to connect the debugger to the Keil ULINK Adapter. The CPU stops and connects to the CoreSight debug port of the Kinetis K60 device. For details on the debugging features, refer to the µVision User's Guide.

Note

  • Debugging the BLINKY program using the µVision Debugger requires a ULINK USB-JTAG adapter.

The System Viewer menu allows you to open different dialogs for Peripheral units on the Kinetis Kxx devices. You may view and/or change the state and configuration of on-chip peripherals using these dialogs. For example:

The PTA dialog reflects the status of this I/O port.


MCBTWRK60 User's Guide: Downloading BLINKY

Downloading BLINKY

Download to Flash Button When the BLINKY program is built, you may download the program to the MCBTWRK60 using the Keil ULINK USB-JTAG Adapter

The BLINKY application starts executing when you press RESET on the MCBTWRK60 board to verify the program downloaded.

Note

  • You may enable the option Update Target before Debugging to download the BLINKY project whenever you start a Debug Session.

The downloaded program is ready for debugging.


MCBTWRK60 User's Guide: Checking Program Output

Checking Program Output

To check the program output from the BLINKY program, start the program running either from the debugger via JTAG or by cycling power on the board. LEDs E1-E3 will flash sequentially indicating that the program is running normally.


MCBTWRK60 User's Guide: Example Programs

Example Programs

The Keil MDK-ARM Development Tools download includes several example programs that are configured for the Keil MCBTWRK60 Board.

Each example program is stored in a separate folder in \KEIL\ARM\BOARDS\FREESCALE\TWR-K60N512\ along with project files that help you quickly build the project and run the program.

The following example programs are installed automatically:

  • BLINKY
    This project uses the LEDs and LCD panel to display the current value of the A/D converter input AD0.0 controlled by the on-board potentiometer.


MCBTWRK60 User's Guide: Programming Flash

Programming Flash

The MCBTWRK60 board supports downloading programs to Flash memory using the ULINK JTAG adapter. The ULINK USB-JTAG Adapter connects the USB port of your PC to the JTAG port of the MCBTWRK60. It supports programming Flash, emulation, and debug capabilities.


MCBTWRK60 User's Guide: ULINK USB-JTAG Adapter

ULINK USB-JTAG Adapter

The ULINK2 USB-JTAG Adapter allows you to debug and test programs and to program Flash memory on the MCBTWRK60 Tower System. To setup ULINK2 for Programming Flash within the µVision IDE, you must:

  1. Connect the ULINK2 to the JTAG connector of the TWR-K60N512 Board.
    Note that the red cable marks pin 1 of the JTAG-connector.

    MCBTWRK60 board connected to the ULINK2 JTAG Adapter

    Note:

    • The CoreSight debug port in the Kinetis core can be disabled when the device is in Power Down or Low Power mode. ULINK stops working if your code puts the ARM device into Low Power or Power Down mode. Therefore, do not enable either of the power saving modes of the Kinetis K60 during the software development cycle in your application program. However if the CoreSight debug port becomes disabled, it can be re-enabled.
  2. Power up the MCBTWRK60 Tower System.
  3. Set the JTAG clock for your ULINK2 adapter.
  4. Configure Flash Programming in the Project — Options for Target — Utilities dialog.

    Options for Target Button Click the toolbar button and select the Utilities tab.

    Use Target Driver Option For ULINK2 and ULINK-ME:
    Set the Use Target Driver for Flash Programming option, then select the ULINK Cortex Debugger to choose the ULINK2 or ULINK-ME USB-JTAG Adapter as the Flash programming tool.

    Use Target Driver Option For ULINKpro:
    Set the Use Target Driver for Flash Programming option, then select the ULINK Pro Cortex Debugger to choose the ULINKpro USB-JTAG Adapter as the Flash programming tool.

    Update Target Option Check the Update Target before Debugging option to ensure that the Flash ROM gets programmed whenever the debugger starts.

    Settings Button Click the Settings button to open the Flash Download Setup dialog for the next step.

  5. Configure the Flash Download Setup dialog.

    Flash Download — RAM for Algorithm In the RAM for Algorithm section, set the Start: parameter to 0x1FFF0000 and the Size: parameter to 0x0800

  6. Click the Add button and select the MKXX 512kB Prog Flash algorithm.

    Flash Download -- Programming Algorithm

    Finally, click the OK button to save the Flash Download settings.

  7. Download your application to Flash.

    Download to Flash Button Use the Download to Flash toolbar button to download the application program into the Kinetis device.

    The ULINK-JTAG adapter can also be used for downloading and debugging application code in Flash ROM or in RAM of the Kinetis microcontroller.


MCBTWRK60 User's Guide: Kit Contents

Kit Contents

The MCBTWRK60 Tower System includes:

  • The TWR-K60N512 Module.
  • The TWR-SER Serial Module.
  • The Primary and Secondary TWR-ELEV Elevator Modules.
  • A µVision IDE Quick Start Guide.
  • An ARM Development Tools Overview.
  • Example Programs for the MCBTWRK60 Tower System are located in the folder KEIL\ARM\BOARDS\FREESCALE\TWR-K60N512. All examples can be compiled and debugged using the Lite Edition.


MCBTWRK60 User's Guide: Features

Features

The connectors on the MCBTWRK60 evaluation board provide easy access to many of the on-chip peripherals.

  • USB 2.0 Full Speed Interface
    Standard USB connectors for USB Device, USB-OTG, USB Host and UART via USB on the MCBTWRK60 board for applications requiring USB communications.
  • Serial Port
    A standard DB9 connector on the Serial board for Kinetis's serial port provides RS232 and RS485 connectivity.
  • 100/10M Ethernet Port
    A standard RJ45 connector on the MCBTWRK60 Serial board connects to an on-board Ethernet transceiver for applications requiring Ethernet communications.
  • CAN Interface
    A 3-pin header for applications requiring CAN communications on the MCBTWRK60 Serial board.
  • Accelerometer
    A 3-axis accelerometer for detecting and measuring motion in 3 dimensions on the MCBTWRK60 Serial board.
  • Touch Interface
    Four touch pads on the TWR-K60N512 board connected to the Touch Sensing Input module in the MCU allow them to be used as push buttons in your application.
  • SD Card Connector
    A SD Card connector for developing applications requiring access to SD Cards.
  • Analog Voltage Control for ADC Input
    An adjustable analog voltage source is on the TWR-K60N512 board for testing the Analog to Digital output feature of the Kinetis device. A configuration jumper enables and disables this feature.
  • JTAG and Cortex/ETM Download and Debug
    The TWR-K60N512 board incorporates a Cortex Debug + ETM interface. When coupled with the ULINK2 USB-JTAG adapter, the Serial Wire JTAG interface allows flash programming and debugging. With the ULINKPro adapter, the Cortex Debug/ETM interface allows flash programming and instruction trace debugging.


MCBTWRK60 User's Guide: Hardware Requirements

Hardware Requirements

To use the MCBTWRK60 Evaluation Kit, you need:

  • The MCBTWRK60 Tower System.
  • A PC with:
    • One USB port for downloading and debugging.
    • Another USB port to provide power to the board.

To download and debug, one of the following:

  • A Keil ULINK2 USB-JTAG Adapter.
  • A Keil ULINK-ME USB-JTAG Adapter.
  • A Keil ULINKpro USB-JTAG Adapter.

Plus:

  • 1 USB A-B cable for connecting the ULINK2 or ULINKpro adapter.
  • 1 USB A-miniB cable to power the tower system.


MCBTWRK60 User's Guide: Quick Start

Quick Start

Use the following table to locate important information about the MCBTWRK60 board and get started quickly.

To… | See…
Connect power to the MCBTWRK60 board. | Setup
Connect the MCBTWRK60 via ULINK/JTAG to your PC. | Connecting the MCBTWRK60
Read about the default configuration settings. | Configuring the MCBTWRK60
Configure the tool options for the MCBTWRK60 board. | Writing Programs
Learn more about the µVision IDE. | µVision User's Guide
Review the MCBTWRK60 schematics. | Schematics


MCBTWRK60 User's Guide: Software Requirements

Software Requirements

You must install the following required software to use the MCBTWRK60 Tower System:

Windows Operating System

The Keil µVision tool chain runs in these Windows Operating Systems:

  • Microsoft Windows XP
  • Microsoft Windows Vista
  • Microsoft Windows 7

Tools and Examples

To compile, link, and run applications on the MCBTWRK60 Evaluation Kit, you must install these Keil products:

  • Keil MDK-ARM Evaluation Tools.
  • Example programs written for the MCBTWRK60. These programs are included in all Keil MDK-ARM Toolkits.


MCBTWRK60 User's Guide: Introduction

Introduction

The Keil MCBTWRK60 Tower System allows you to generate and test application programs for the Freescale Kinetis Kxx device family. With this hands-on process, you can determine the hardware and software requirements for current and future product development.

This TWR-K60N512 board is populated with the Freescale Kinetis MK60N512VMD100 microcontroller.

MCBTWRK60 Tower System


MCBTWRK60 User's Guide: Theory of Operation

Theory of Operation

The Theory of Operation explains the MCBTWRK60 board hardware. The descriptions help you to understand the MCBTWRK60 board components and how to use the available I/O interfaces.

The MCBTWRK60 is designed to be a very flexible evaluation board for the Freescale Kinetis family of microprocessors. The MCBTWRK60 evaluation board can be expanded to build hardware prototypes.


MCBTWRK60 User's Guide: Writing Programs

Writing Programs

The Writing Programs topics introduce you to the Keil development tools, and show you, step-by-step, the process of using them with the MCBTWRK60 tower system. You will learn how to use µVision to create, compile, download, debug, and run a program on the MCBTWRK60 tower system.

Writing programs for the MCBTWRK60 tower system is easy.

  1. Create the Application Program using the µVision IDE and the ARM C/C++ Compiler.
  2. Download the program to the on-chip Flash of the MCBTWRK60 tower system.
  3. Debug the program using µVision Debugger and ULINK.

Note

  • Use the Keil MDK-ARM Lite Edition if no other version is installed on the computer.


MCBTWRK60 User's Guide: Setup

Setup

Setting up the MCBTWRK60 Tower System is easy. Explanations for the board setup and its components are presented here. Details about the connecting and configuring procedures for the MCBTWRK60 Tower System are also presented, with a separate topic for the connector descriptions. Setup includes using the MCBTWRK60 Tower System with a ULINK adapter.

The MCBTWRK60 Tower System requires a USB connection for power and another USB connection for the ULINK-USB adapter between your development PC and the JTAG connector.

Before you start, make sure you have satisfied the hardware and software requirements.


MCBTWRK60 User's Guide: Assembling the Tower System

Assembling the Tower System

The MCBTWRK60 Tower System consists of the following 4 PC boards:

  • A TWR-K60N512 module
  • A TWR-SER Serial module
  • A TWR-ELEV Primary Elevator module
  • A TWR-ELEV Secondary Elevator module

The Primary and Secondary Elevator modules provide the connection between the TWR-K60N512 and Serial modules.

To assemble the Tower System modules:

  1. Insert the edge connector marked with a white stripe on the TWR-K60N512 module into the top connector (J1) of the Primary Elevator module as shown below.

    Note

    • The Primary Elevator module has white connectors and the Secondary Elevator module has black connectors. The TWR-K60N512 and Serial modules have 2 edge connectors: one edge connector is marked with a white stripe. Make sure you plug the edge with the white stripe into the Primary Elevator module for each board.

    MCBTWRK60 Tower Assembly

    Assembling the TWR-K60N512 Module to the Primary Elevator Module

  2. Insert the edge connector marked with a white stripe on the Serial Module into the bottom connector (J4) of the Primary Elevator module.
  3. Insert the remaining edge connectors on the TWR-K60N512 and Serial modules into the top and bottom connectors of the Secondary Elevator module resulting in the assembly below.

  4. MCBTWRK60 Tower System Assembled


MCBTWRK60 User's Guide: Board Setup

Board Setup

The MCBTWRK60 Tower System connects directly to the Keil µVision Debugger using the Cortex Debug connector on the TWR-K60N512 module to the Keil ULINKpro USB-JTAG Adapter. No additional software is required on the board.

MCBTWRK60 Board with ULINKpro

The MCBTWRK60 Tower System connects to a PC via a standard USB cable that provides power.


MCBTWRK60 User's Guide: Board Components

Board Components

The following illustration shows the important interface and hardware components of the MCBTWRK60 Tower System.

TWR-K60N512 Board Components

MCBTWRK60 Board Components

Serial Board Components

MCBTWRK60 Serial Board Components


MCBTWRK60 User's Guide: Configuring the MCBTWRK60

Configuring the MCBTWRK60

The MCBTWRK60 Tower System is configured using the jumpers below. The MCBTWRK60 Board ships with the following configuration:

TWR-K60N512 Jumpers

Jumper | State | Description
J1 | ON | Connects USB power from Primary Elevator to VREGIN.
J2 | OFF | Disconnects the IR Transmitter from PTD7/CMT_IR0.
J6 | 1-2 | Selects the on-board 50 MHz oscillator.
J8 | ON | Connects 3.3VDC to the MCU.
J9 | 1-2 | Connects the on-board battery to the VBAT pin.
J10 | OFF | OSJTAG debug mode
J12 | OFF | Disconnects on-board 5.0 VDC from the JTAG port.

TWR-SER Jumpers

Jumper | State | Description
J2 - Enet PHY Clock | 1-2 | Selects the 25MHz clock for Ethernet PHY
J3 - Clock Select | None | Disconnects the clock from CLOCKIN0
J5 - CAN Options | 1-2 3-4 5-6 7-8 9-10 | Selects CAN transceiver sleep mode. Connects sleep pin to CAM pin B43 Connects RXD pin to CANRX pin B41 Connects TXD pin to CANTX pin B42 Connects 120ohm termination resistor
J6 - Enet INT Select | None | No Ethernet IRQ selected
J10 - USB VBUS | 1-2 | USB connector supplies 5V (Host Mode)
J11 - USB OTG INT | None | No USB OTG IRQ selected
J12 - Enet PHY | None | Default configuration
J13 - RS232/485 Cfg. | None | Standard configuration
J15 - RS232/485 Sel. | 1-2 | RS232 operation
J16 - USB Mode Sel. | 1-2 | Host Mode - supply 5V to VBUS
J17 - RSxxx RX Sel. | 1-2 | RS232
J18 - RSxxx RTS Sel. | None | No RTS
J19 - RSxxx TX Sel. | 1-2 | RS232

Configuring for the ULINK USB-JTAG Adapter

The default jumper settings (above) on the MCBTWRK60 board are pre-configured for ULINK2 and ULINKpro USB-JTAG adapters.


MCBTWRK60 User's Guide: Connecting with ULINK

Connecting with ULINK

To use the MCBTWRK60 Tower System with ULINKpro or ULINK2, you must:

  • Connect the ULINK 20-pin ribbon connector to the Cortex Debug connector of the TWR-K60N512 board.
  • Connect ULINK to the PC via a standard USB A/B cable.
  • Connect power to the board using a standard USB A/miniB cable. You may use the miniUSB connector on the TWR-K60N512 module(shown) or the Primary Elevator module to power the board.
  • Set the JTAG clock for your ULINKpro or ULINK2 adapter.

The following picture shows how to connect ULINK2 to the TWR-K60N512 board.

TWR-K60N512 Board Connected to the ULINK2 JTAG Adapter


MCBTWRK60 User's Guide: Setting the SW Clock

Setting the SW Clock

To get the best performance from your ULINK JTAG adapter, it's important to set the clock rate for communicating with the TWR-K60N512 board. The following steps show you how this is done.

  1. Power up the MCBTWRK60 Tower System.
  2. In µVision, Configure the Debugger in the Project — Options for Target — Debug dialog.

    Options for Target Button Use the Options for Target toolbar button and click the Debug tab to display the Debug dialog.

    For ULINK2 and ULINK-ME:
    Use: ULINK ARM Debugger Select the Use: radio button and then ULINK Cortex Debugger in the drop-down list to choose the ULINK2 or ULINK-ME USB-JTAG Adapter as the debugging tool.

    For ULINKpro:
    Use: ULINK ARM Debugger Select the Use: radio button and then ULINK Pro Cortex Debugger in the drop-down list to choose the ULINKpro USB-JTAG Adapter as the debugging tool.

  3. Click the Settings button to open the Cortex-M Target Driver Setup dialog.

    Target Driver Setup - ULINK2 Adapter Check the SWJ checkbox and select the SW option under Port to use the Single Wire mode interface.

    The Max Clock drop-down list sets the highest clock rate used to communicate to the target board. When using a ULINK adapter, the 1MHz setting works best with the TWR-K60N512 board.

    To ensure that the TWR-K60N512 board initializes properly when you download or debug, in the Connect & Reset Options section, verify that the Connect: option is set to under Reset, the Reset: option is set to HW RESET, and the Reset after Connect check box option is checked as shown.

    Debug Options


MCBTWRK60 User's Guide: Jumper Descriptions

Jumper Descriptions

TWR-K60N512 Jumpers

The jumpers used to configure the MCBTWRK60 TWR-K60N512 board are:

  • J1: connects USB power from the Primary Elevator to the VREGIN on the board.
  • J2: connects the IR transmitter to PTD7/CMT_IRO/UART0_TX.
  • J6: jumpering the 1-2 position selects the on-board 50 MHz clock. Jumpering the 2-3 position uses a clock signal from the Primary Elevator board.
  • J8: connects the on-board power supply to the MCU.
  • J9: jumpering 1-2 connects the on-board power supply to VBAT. Jumpering 2-3 connects VBAT to the coin-cell battery.
  • J10: selects OSJTAG bootloader mode for OSJTAG reprogramming.
  • J12: connects 5 VDC to the JTAG port.

TWR-SER Jumpers

The jumpers used to configure the MCBTWRK60 Serial board are:

  • J2 Ethernet PHY Clock Select:
    • 1-2 Select 25MHz clock
    • 3-4 Select 50MHz clock
    • 5-6 Select the CLOCKOUT0 signal
  • J3 CLOCKIN0 Driver Select: connects either the 25MHz(1-2) or 50MHz(2-3) clock to CLOCKIN0.
  • J5 CAN Options:
    • 1-2 CAN transceiver to sleep mode
    • 3-4 Connect Sleep to CAN pin B43
    • 5-6 Connect RXD pin to CANRX pin B41
    • 7-8 Connect TXD pin to CANTX pin B42
    • 9-10Connect 120 ohm termination resistor
  • J6 Ethernet PHY Interrupt Select:
    • 1-2 IRQ_H
    • 3-4 IRQ_F
    • 5-6 IRQ_D
    • 7-8 IRQ_B
  • J10 USB VBUS Select:
    • 1-2 5V is supplied to the USB connector (Host Mode)
    • 2-3 5V is provided by the attached USB device
  • J11 USB OTG Interrupt Select:
    • 1-2 IRQ_H
    • 3-4 IRQ_F
    • 5-6 IRQ_D
    • 7-8 IRQ_B
  • J12 Ethernet PHY Configuration:
    • 1-2 Pull-up PHYAD2: PHY Address Select
    • 3-4 Pull-up PHYAD1: PHY Address Select
    • 5-6 Pull-down PHYAD0: PHY Address Select
    • 7-8 Pull-up CONFIG2: Loopback Select
    • 9-10 Pull-up CONFIG0: RMII Select
    • 11-12 Pull-up ISO: Isolation Mode Select
    • 13-14 Pull-down SPEED: 10Mbps Select
    • 15-16 Pull-down DUPLEX: Half-duplex Select
    • 17-18 Pull-down NWAYEN: Disable Auto-Negotiation
  • J13 RS232/485 Configuration:
    • 1-2 Connect RS485 Receive En and Driver En
    • 3-4 Connect RS485 RX+ to TX+: Loopback
    • 5-6 Connect RS485 RX- to TX-: Loopback
    • 7-8 Enable ELE_CTS (A9) as RS232 CTS
    • 9-10 Supply 5V on DB9 pin 6
  • J15 RS232/RS485 Select:
    • 1-2 RS232
    • 2-3 RS485
  • J16 USB Mode Select:
    • 1-2 Host Mode - Supply 5V to VBUS
    • 3-4 Device Mode - VBUS supplies 5V
    • 5-6 OTG Mode - VBUS controlled by OTG charge pump
  • J17 RS232/RS485 RX Select:
    • 1-2 RS232
    • 2-3 RS485
  • J18 RS232/RS485 RTS Select:
    • 1-2 RS232
    • 2-3 RS485
  • J19 RS232/RS485 TX Select:
    • 1-2 RS232
    • 2-3 RS485


MCBTWRK60 User's Guide: Accelerometer

Accelerometer

The MCBTWRK60 board includes a Freescale MMA7660FC 3-axis accelerometer at U5 connected to PTD8, PTD9, and PTD10.

MCBTWRK60 Board Accelerometer


MCBTWRK60 User's Guide: Block Diagram

Block Diagram

The hardware block diagram displays input, configuration, power system, and User I/O on the TWR-K60 board and the Serial I/O board. This visual presentation helps you understand the MCBTWRK60 tower system components.

MCBTWRK60 System Block Diagram


MCBTWRK60 User's Guide: Push Buttons & Touch Pads

Push Buttons & Touch Pads

Push Buttons

The two push buttons on the MCBTWRK60 board are:

  • The RESET push button connects to the reset circuit. Pushing this button manually resets the microcontroller.
  • SW1 is a general purpose push button that connects to port pin PTA19 of the microcontroller.
  • SW2 is a general purpose push button that connects to port pin PTA26 of the microcontroller.

Touch Pads

The MCBTWRK60 board has 4 capacitive touch pads (E1-E4) connected to the Touch Sensing Input (TSI) module of the Kinetis MCU. The E1, E2, E3 and E4 touch pads are connected to port pins PTA11, PTA28, PTA29, and PTA10, respectively.

MCBTWRK60 Board Buttons


MCBTWRK60 User's Guide: CAN Interface

CAN Interface

The CAN Interface uses the TJA1050 CAN driver (U4) and termination resistor which can be eliminated by removing Jumper 9-10 at J5.

MCBTWRK60 Serial Board CAN

The CAN connectors is the 3-pin header at J7. J7-pin 1 connects to CANH, J7-pin 2 connects to ground and J7-pin 3 connects to CANL.


MCBTWRK60 User's Guide: Microcontroller

Microcontroller

The Freescale Kinetis K60 microcontroller (U1) provided with the MCBTWRK60 board is a high-end MK60N512VMD100 device with advanced capabilities.

A 50.0 MHz oscillator (Y1) provides the clock signal for the CPU when a jumper is installed on pins 1-2 of jumper J6. Moving the jumper to pins 2-3 allows external clocking from another board via the Primary Elevator.

MCBTWRK60 Board Microcontroller


MCBTWRK60 User's Guide: Ethernet Interface

Ethernet Interface

The Ethernet Interface on the MCBTWRK60 Serial Module uses the 10/100 Ethernet 1.8V Micrel KSZ8041NL transceiver at location U3. Jumpers at J2, J3, J6 and J12 configure the Ethernet interface.

MCBTWRK60 Serial Board - Ethernet Interface


MCBTWRK60 User's Guide: Cortex Debug + ETM Interface

Cortex Debug + ETM Interface

The Cortex Debug interface connector provides JTAG and SWD debugging and emulator support for the Freescale Kinetis K60N512 Cortex-M4 device. This interface allows application debugging and programming of on-chip and off-chip Flash devices.

Serial Wire JTAG is capable of Serial Wire Output for target debugging in addition to allowing application programming and debugging of on-chip and off-chip Flash devices as in standard JTAG.

The Cortex Debug connector also provides instruction-level trace (ETM) debugging support for the Kinetis device at the Cortex Debug connector.

MCBTWRK60 Board JTAG

The 20-pin Cortex Debug header (Samtec FTSH-120) works with the Keil ULINK2 and ULINKpro and many third party tool vendors.

Note

  • ULINK2 users will need a 10-pin to 20-pin cable not shipped with older ULINK2 adapters. Those users should contact Keil Sales for help in acquiring this cable.
  • When using ULINK2 or ULINKpro, make sure the jumpers at location J10 and J12 are removed.
  • The ULINK2 adapter does not support ETM trace.

Cortex Debug and JETM Pin Identification


MCBTWRK60 User's Guide: LEDs

LEDs

TWR-K60N512 Board

The LEDs on the TWR-K60N512 module are:

  • The RESET LED indicates any time the MCU is reset (/RESET).
  • The TPWR LED indicates that 5.0 VDC power is being provided from the on-board regulator.
  • The STATUS LED indicates that OBSDM Serial Bridge is operational.
  • The POWER LED indicates that 3.3 VDC power is present on the board.
  • The 4 Port LEDs marked E1, E2, E3 and E4 connect to port pins PTA11, PTA28, PTA29 and PTA10, respectively. These LEDs are useful for indicating program status while testing your applications.

MCBTWRK60 TWR-K60N512 Board

Serial Board

The LEDs on the TWR-SER Serial module are:

  • The 5V LED indicates that 5.0 VDC is present on the Serial module.
  • The 3V3 indicates that 3.3 VDC is present on the Serial module.
  • The ORANGE LED (right/lower) on the Ethernet connector indicates LAN traffic is present.
  • The GREEN LED (left/upper) on the Ethernet connector indicates a good link connection to the LAN.

MCBTWRK60 Serial Board


MCBTWRK60 User's Guide: Potentiometer

Potentiometer

The potentiometer on the MCBTWRK60 board connects to ADC1_DM1 (DAD1). The voltage range is 0.0-5.0 Volts.

MCBTWRK60 Board with Potentiometer


MCBTWRK60 User's Guide: Power Supply

Power Supply

Power is supplied to the MCBTWRK60 board on your PC using a standard USB B connector, or from the Primary Elevator module when installed as a tower system.

Jumper J8 may be removed to apply alternate power to the MCU, or for purposes of measuring MCU power consumption.

The voltage regulator (U9) generates 3.3 Volts DC. The POWER LED indicates 3.3V power is present on the board.

The USB Power switch (U2) enables 5.0 Volts DC. The TPWR LED indicates 5.0V power is supplied from the on-board USB connector (J13).

The CR2032 lithium battery supplies 3.0 Volts DC to power the Real-time Clock peripheral. The J9 jumper connects this battery to the VBAT pin.

MCBTWRK60 Board Power >


MCBTWRK60 User's Guide: Schematics

Schematics

Detailed schematics are available in large format on the MCBTWRK60 Tower System information section of the Keil web site.

TWR-K60N512 Board Schematics

TWRK60N512 Board Schematics

TWR-SER Serial Board Schematics

TWR-SER Serial Board Schematics

TWR-ELEV Primary Board Schematics

TWR-ELEV Primary Board Schematics

TWR-ELEV Secondary Board Schematics

TWR-ELEV Secondary Board Schematics

Copyright © Keil, An ARM Company. All rights reserved.


MCBTWRK60 User's Guide: SD Card Connector

SD Card Connector

The MCBTWRK60 board supports one SD memory card connector on the back of the board that allows you to connect a wide range of SD memory cards.

MCBTWRK60 Board with SD Connector


MCBTWRK60 User's Guide: Serial Port

Serial Port

The Serial module of the MCBTWRK60 tower system includes serial UART connected to the ICL3225E RS232 transceiver (U6), which converts the logic signals to RS232 voltage levels.

Jumpers J13, J15, J17, J18, and J19 configure the J8 connector for RS232 or RS485 operation.

MCBTWRK60 Board Serial Port

The RS232 DB9 connector is wired as a standard 5-wire TXD/RXD/RTS/CTS interface as shown in the figure below.

DB9 Connector Wiring for RS232


MCBTWRK60 User's Guide: Technical Data

Technical Data

Parameter | Description
Supply Voltage | 5V DC (provided by the USB bus of a PC).
Supply Current | 280mA typical, 300mA maximum
XTAL Frequency | 50 MHz
Microcontroller | Freescale PK60N512VMD100
Peripherals | 1 × RS232 Interface (on Serial Board), 1 × Ethernet Interface (on Serial Board), 1 × USB 2.0 Device/Host/OTG Interface (on Serial Board), 1 × Cortex Debug Interface (on Serial Board), 1 × ETM Interface, 1 × Cortex Debug Interface, 1 × Touch Sensing Interface, 1 × SD Card Interface, 1 × Accelerometer, 1 × Infrared Transmit/Receive Interface, 1 × Analog Input (connected to potentiometer by default)
Board Size | 90mm x 18mm (3.55" x 3.175"). Assembled: 90mm x 90mm x 90mm (3.55" x 3.55" x 3.55")


MCBTWRK60 User's Guide: USB Interface

USB Interface

The Serial module of the MCBTWRK60 tower system supports USB Device, Host and OTG modes via a standard USB mini AB connector on that board. Jumpers J10, J11, and J16 on the Serial Module configure the USB interface.

MCBTWRK60 Board USB Connectors

MCBTWRK60 Serial Module


MCBTWRK60 User's Guide: Building a Program

Building a Program

When the building a program function starts, you may watch the progress in µVision's Command window. The created executable files are placed in an output folder, ready for downloading. The steps and progress are:

  1. Start the build

    Build Button Click on the Build toolbar button to generate your application program. µVision translates all your source files and links the project.

  2. Monitor progress

    The build activity progress (assembling, compiling, and linking) displays in the µVision's Command window. Any errors or warnings detected during the build process also display in this window.

  3. Program Files

    The build creates an Executable File in ELF Format in the Output folder you designated earlier. The ULINK USB-JTAG adapter requires this file for downloading to the MCBTWRK60 board using the JTAG or other emulators.

The program is now built and ready for test.


MCBTWRK60 User's Guide: Creating a Project

Creating a Project

Follow the steps below to create a new project file and to specify and organize your source (and debug) files that are a part of this project.

  1. Select the ARM Toolset that you want to use for your project.
    The default configuration is the MDK-ARM Toolset and the information below is based on selecting the ARM Compiler.
  2. Create a New Project File with the µVision menu command Project - New Project.
    Select a microcontroller from the Device Database®. The MCBTWRK60 tower system comes with the Kinetis K60, however, you may also use it to develop code for other Kinetis Kxx device variants, since the Kinetis K60 represents a superset of several other Kinetis Kxx devices.
  3. Add Startup Code from the folder ..\ARM\BOARDS\FREESCALE\TWR-K60N512\ to your project. After selecting, µVision prompts with the following dialog:

    'Copy MCBTWRK60 Startup Code' Dialog

    Answer Yes since this startup code works with most Kinetis Kxx projects.

  4. Add your own Source Code to the project using the µVision editor (or any editor of your choice) by either:
    • Right clicking the mouse in the Project Window on a group and select Add Files to Group from the context menu.

    • Or

    • Opening the Project — Components, Environment and Books — Project Components dialog.
      Within this dialog, you may create and organize files into groups, or create other project targets with different tool configurations.

      Components, Environments and Books Dialog


MCBTWRK60 User's Guide: Configuring Output Files

Configuring Output Files

Configure the Output Files in the Project — Options for Target — Output dialog. The steps for configuring these files are:

  1. Select Folder for Objects... this allows you to specify sub-folders for the output files.

    Options for Target - Output - Select Folder

  2. Enable Debug Information to store symbolic debug information within the executable file for source level program testing with the µVision debugger.

    Options for Target - Output - Debug Information Selection

  3. Enable Create HEX File to generate an Intel HEX file for Flash programming with external utilities.

    Options for Target - Create HEX File


MCBTWRK60 User's Guide: Setting Target Options

Setting Target Options

You must select the speed and memory configurations for your target hardware. Since these features of the MCBTWRK60 are fixed, copy the settings as shown below. The steps for setting the target options are:

  1. Open the Target Tab of the Project — Options for Target dialog.

    Options for Target - XTAL Type in the XTAL (MHz) of 50.0 for the oscillator frequency.

  2. Enter the memory ROM area for your target system in IROM1.

    Options for Target - IROM1 Enter the starting address of 0x0 in Start and the size of 0x80000 in Size.

    The Kinetis K60 has on-chip ROM from 0x0 to 0x7FFFF for a total of 0x80000 bytes.

  3. Enter the RAM memory area for your target system in IRAM1.

    Options for Target - IRAM1 Enter the starting address of 0x1FFF0000 in Start and the size of 0x10000 in Size.

    The Kinetis K60 has on-chip RAM from 0x1FFF0000 to 0x1FFFFFFF for a total of 0x10000 bytes.

Note

  • In the licensed (non-evaluation) version of MDK-ARM, the Memory Areas parameters automatically configure the scatter file for the ARM Linker/Locator.


MCBTWRK60 User's Guide: Creating Application Programs

Creating Application Programs

The required steps for creating application programs are outlined here.

µVision includes a Project Manager that makes it easy for you to design applications quickly. The topics below show you how to create a project, set the target options, configure the output files, compiler and linker options, and build an application program that is ready to download to the MCBTWRK60 board.

  1. Creating a Project
  2. Setting Target Options
  3. Configuring Output Files
  4. Building a Program

Detailed information can be found in the µVision User's Guide in the Creating Applications chapter.


MCBTWRK60 User's Guide: Keil MDK-ARM

Keil MDK-ARM

To use the MCBTWRK60 Tower system download the Lite Edition of the Keil Microcontroller Development Kit (MDK-ARM). The MDK-ARM Lite Edition includes:

  • Powerful and easy-to-use µVision IDE that includes editor, project management, and make capability.
  • µVision Debugger with complete CPU, peripheral simulation, and driver for the Keil ULINK USB-JTAG Adapter.
  • ARM Compilation Tools that include ANSI C/C++ Compiler and related utilities.
  • RTX RTOS Kernel for the ARM Compiler.
  • Extensive tutorials and documentation.

The restrictions for the MDK-ARM Lite Edition are:

  • The image ROM size of the generated application is limited to 16KB maximum.
  • The linker does not accept scatter-loading description files for sophisticated memory layouts.
  • The base address for code/constants is restricted to 0xXX000000, 0xXX800000, or 0x00080000 whereby XX stands for 00, 01, ..., FF. This allows memory start address like 0x00000000, 0x12800000 and so on.
  • It is not possible to generate position independent code or data.
  • The compiler does not generate a listing file.


MCBTWRK60 User's Guide: Application Notes

Application Notes

Keil Software provides numerous Application Notes that discuss solutions to special problems. These are available on the Keil web site at: http://www.keil.com/appnotes/

Application Notes are available for various topics like Ethernet Programming, Complex Device Simulation and many more.