xtimecomposer Studio Tutorial

Similar documents
Introduction to Simulation of Verilog Designs Using ModelSim Graphical Waveform Editor. 1 Introduction. For Quartus II 13.1

Introduction to Simulation of Verilog Designs. 1 Introduction. For Quartus II 13.0

Introduction to Simulation of Verilog Designs. 1 Introduction

Basic Tutorial of Circuit Maker

Introduction to Simulation of Verilog Designs. 1 Introduction. For Quartus II 11.1

Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15. Figure 2: DAD pin configuration

Quartus II Simulation with Verilog Designs

Hello, and welcome to this presentation of the STM32 Infrared Timer. Features of this interface allowing the generation of various IR remote control

Using the S5U13781R01C100 Shield Graphics Library with Atmel Studio

Triscend E5 Support. Configurable System-on-Chip (CSoC) Triscend Development Tools Update TM

CE PSoC 6 MCU Breathing LED using Smart IO

RC Filters and Basic Timer Functionality

Quartus II Simulation with Verilog Designs

TLE5014 Programmer. About this document. Application Note

AN4379 Application note

RAGE TOOL KIT FAQ. Terms and Conditions What legal terms and conditions apply to the RAGE Tool Kit?

Signal Integrity Analyzer

BIM Toolbox. User Guide. Version: Copyright 2017 Computer and Design Services Ltd GLOBAL CONSTRUCTION SOFTWARE AND SERVICES

AN2581 Application note

Annex IV - Stencyl Tutorial

EXPERIMENT 1: INTRODUCTION TO THE NEXYS 2. ELEC 3004/7312: Signals Systems & Controls EXPERIMENT 1: INTRODUCTION TO THE NEXYS 2

Using the Z8 Encore! XP Timer

Welcome to Polaroid PhotoMAX FUN!

LP3943/LP3944 as a GPIO Expander

High Resolution Pulse Generation

Tutorial Three: Categorising ideas using the SuperGrouper tool In Kidspiration there are two basic ways to organise ideas in Picture View: links and

Welcome to 6 Trait Power Write!

Using Z8 Encore! XP MCU for RMS Calculation

MN E. Waveform Viewer: Power Xpert Software 2.2

Generating DTMF Tones Using Z8 Encore! MCU

tinyavr 1-series Training

Use Corel Snapfire 2.0 to create scrapbook pages, greeting cards and more!

Pulse-Width-Modulation Motor Speed Control with a PIC (modified from lab text by Alciatore)

EECS 312: Digital Integrated Circuits Lab Project 1 Introduction to Schematic Capture and Analog Circuit Simulation

Utilizing the Trigger Routing Unit for System Level Synchronization

Lab 5 Timer Module PWM ReadMeFirst

LED controllers. Voltage-switch drivers, constant-current drivers, and Flash LED drivers

Downloading a ROBOTC Sample Program

XLR PRO Radio Frequency (RF) Modem. Getting Started Guide

PaperCut PaperCut Payment Gateway Module - Heartland Quick Start Guide

LAX016 Series Logic Analyzer User Guide

Firmware plugin for STSW-ESC001V1 board with ST Motor Control FOC SDK

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes

Tutorials. OptiSys_Design. Optical Communication System Design Software. Version 1.0 for Windows 98/Me/2000 and Windows NT TM

ECEN 449: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University

Creating a job with Fotoba marks

Lab 2: Introduction to Real Time Workshop

LV8716QAGEVK Evaluation Kit User Guide

UM DALI getting started guide. Document information

Controlling DC Brush Motor using MD10B or MD30B. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

CAD Tutorial. CAD Detail Windows. In this tutorial you ll learn about: CAD Detail Windows Exploding and Modifying a CAD Block

Introduction to the Analog Discovery

Welcome to Arduino Day 2016

1. Setup Output mode. 2. Using a Fixed tile size

SqueakCMI Notebook: Projects, Tools, and Techniques

XGATE Library: PWM Driver Generating flexible PWM signals on GPIO pins

Materials Tutorial. Chapter 6: Setting Materials Defaults

Application Note. Smart LED Dimmer Controlled via Bluetooth AN-CM-225

PGT313 Digital Communication Technology. Lab 3. Quadrature Phase Shift Keying (QPSK) and 8-Phase Shift Keying (8-PSK)

Cyclone II Filtering Lab

DESCRIPTION DOCUMENT FOR WIFI SINGLE DIMMER ONE AMPERE BOARD HARDWARE REVISION 0.3

Stratix II Filtering Lab

ArbStudio Training Guide

32-bit ARM Cortex-M0, Cortex-M3 and Cortex-M4F microcontrollers

VISSIM Vehicle Actuated Programming (VAP) Tutorial

AN3332 Application note

Submittals Quick Reference Guide

AVR42778: Core Independent Brushless DC Fan Control Using Configurable Custom Logic on ATtiny817. Features. Introduction. AVR 8-bit Microcontroller

Apogee Ensemble Thunderbolt Audio Interface

Contents. Saffire PRO 10 i/o. User Guide. Changes to Version 1. Additional Info. Hardware Monitoring Digital Output Monitoring...

Stratix Filtering Reference Design

ArbStudio Triggers. Using Both Input & Output Trigger With ArbStudio APPLICATION BRIEF LAB912

AN2979 Application note

CDM10V programming user manual describes the COOLDIM_PRG_BOARD burner board usage, the UART protocol handling and the fusing details.

Lesson 3: Arduino. Goals

ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab

Iowa State University Electrical and Computer Engineering. E E 452. Electric Machines and Power Electronic Drives

Materials Tutorial. Setting Materials Defaults

Apogee Ensemble Thunderbolt Audio Interface

AN797 WDS USER S GUIDE FOR EZRADIO DEVICES. 1. Introduction. 2. EZRadio Device Applications Radio Configuration Application

Introduction to LT Spice IV with Examples

Embroidery Gatherings

MAX11300PMB1 Peripheral Module and Munich (USB2PMB1) Adapter Board Quick Start Guide

EE 210 Lab Exercise #3 Introduction to PSPICE

Copyright 2009 Aladdin Knowledge Systems Ltd. All rights reserved. All trade and service marks, logos and trade names(collectively, the "Marks")

ANLAN203. KSZ84xx GPIO Pin Output Functionality. Introduction. Overview of GPIO and TOU

Installation Instructions

AT15291: Migrating QTouch Designs from SAM D MCUs to SAM C MCUs. Scope. Features. QTouch APPLICATION NOTE

Managing Metastability with the Quartus II Software

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

EG1003 Help and How To s: Revit Tutorial

Endurance R/C Wi-Fi Servo Controller 2 Instructions

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

USB-PWM10. User s Manual

5D PortraitStitch: Photos to Portraiture

Ansoft Designer Tutorial ECE 584 October, 2004

Quick Start Training Guide

SM 4117 Virtual Reality Assignment 2 By Li Yiu Chong ( )

74ACT11374 OCTAL EDGE-TRIGGERED D-TYPE FLIP-FLOP WITH 3-STATE OUTPUTS

Materials Tutorial. Chapter 6: Setting Materials Defaults

Transcription:

xtimecomposer Studio Tutorial IN THIS DOCUMENT Introduction The xsoftip Explorer Perspective Your first application Creating a project from the xsoftip Using xsoftip in the Edit perspective Test your project in the simulator The xtimecomposer Waveform Viewer Next steps 1 Introduction Welcome to xtimecomposer. This tutorial provides an introduction to xtimecomposer Studio and xsoftip Explorer. It shows you how to: Create an application using xsoftip Explorer Create a project from xsoftip using xtimecomposer Edit a xsoftip component in xtimecomposer Test your program in the XMOS simulator We recommend that you follow the tutorial step-by-step. If you need to download the source code for the examples discussed it is available from xmos.com xtimecomposer Tutorial Code Examples 1. 2 The xsoftip Explorer Perspective xsoftip components use xcore resources to provide interfacing, DSP, protocols and control functions, allowing you to concentrate on building your application. 1. Select Window > Open Perspective > XMOS xsoftip Explorer to open the xsoftip Explorer perspective. The xsoftip Explorer Perspective allows you to browse the XMOS xsoftip components and select them for use in your system. It provides resource information so you know which XMOS multicore microcontroller is most suitable for your application. The xsoftip Explorer Perspective has four windows: 1 http://www.xmos.com/published/xtimecomposer-studio-tutorial-code?version=latest Publication Date: 2013/5/29 XMOS 2013, All Rights Reserved

xtimecomposer Studio Tutorial 2/11 xsoftip Browser shows the xsoftip components you can chose for your project My System Configuration: the xsoftip components you have selected System Information: the resources used by the xsoftip components you have selected, and the XMOS multicore microcontrollers which suit your application Developer Column: online documentation about the xsoftip, tools and xcore multicore microcontrollers NOTE: Additional documentation will be loaded in other tabs in the Developer Column. Tabs are located at the bottom of the Developer Column. You will need to switch between the xtutorial tab and the Main tab to see the xsoftip documentation. 2.1 xsoftip Component Scope Each xsoftip component is categorized with a Scope, which shows the status of the xsoftip component: General Use: The xsoftip consists of a complete release from XMOS. Complete resource information is available. NOTE: All attempts have been made to ensure the correct functionality of this block, but the final quality of any product using this block is the responsibility of the user. Early Development: The xsoftip is suitable for use in development of products and is fully functional. However, the maturity of the software is such that extra care must be taken in verifying a product using this software block. Resource information is available. Experimental: The xsoftip is at an experimental/prototype stage. Code exists but is not feature complete. Resource information may be available. Roadmap: The xsoftip is on the XMOS development roadmap. Estimated resource information exists for this xsoftip, but no code is available. Open Source Community: The xsoftip has been developed by the Open Source community. Resource information may not be available. 3 Your first application The xsoftip Browser displays all available xsoftip components including hardware interfaces, control functions and DSP processing. This section shows how to use xsoftip to implement a precise PWM driver that uses the real-time capabilities of xcore. 3.1 Add the PWM to your application You can add xsoftip components directly to your application using the xsoftip Explorer perspective.

xtimecomposer Studio Tutorial 3/11 1. Click on the Tutorial Example LED PWM Driver xsoftip component in the slicekit/demos category. The Developer Column shows information on the component including a description of what it does, its features and which xkit Development Kits are suitable for use with this xsoftip. 2. Drag the Tutorial Example LED PWM Driver xsoftip into the My System Configuration window. All peripherals in XMOS are implemented using software, giving you complete freedom to customize the interface to meet your exact requirements. xsoftip is all delivered as C code, so you easily change it to meet your exact requirements. You can also take existing C functions and run them on an xcore. For interfacing to I/O pins and for communicating between logical cores, XMOS has added a handful of operations to C, called XC. 3. The My System Information window is updated to show the resources used by your system configuration. Resources include: Logical Cores: 32bit microcontroller cores. XMOS multicore microcontrollers include 4, 6, 8, 10, 12, 16 and 32 core devices. Ports: I/O pins of XMOS multicore microcontrollers are connected to ports, which allow your software to send and receive data to the pins with extremely low latency. Ports are available in different widths: a 1-bit port is connected to 1 I/O pins, a 4-bit port is connected to 4 I/O pins. Clock Blocks: Clock blocks are used to precisely control timing of I/O pins. Chanends: Channel Ends are part of the xconnect system, allowing the logical cores to send messages to each other through low latency xconnect channels.

xtimecomposer Studio Tutorial 4/11 Timers: Timers are used by the software to control the time at which things happen. They run at 100MHz, giving 10ns precision. A list of Possible Devices is displayed at the bottom of the My System Information window. This shows the xcore multicore microcontrollers that most are suitable for this application. 4 Creating a project from the xsoftip When you create a project from the xsoftip Explorer perspective in xtimecomposer Studio, an example instantiation of your selected xsoftip is added to a new project. A main() function is created, to which you can then easily add your application code. 4.1 Create a project 1. Click the Generate Project button at the top of the My System Configuration window. 2. Enter a name for your project in the Generate Project window, for example PWM. 3. Select slicekit Core Board (L16) from the Target Hardware list for your project. 4. Select tile[1] for the PWM xsoftip in the Specify the tile mappings... control. 5. Click Next. 6. Select XS1_PORT_4A as the port you want to use to drive the LEDs. The GPIO Slice Card has 4 LEDs connected to XS1_PORT_4A.

xtimecomposer Studio Tutorial 5/11 7. Click Finish. xtimecomposer Studio generates a project with your selected xsoftip. 5 Using xsoftip in the Edit perspective xtimecomposer Studio changes to the Edit perspective when it creates a project ready for you to edit the code. You can switch between perspectives at any time using the Window > Open Perspective menu. This section shows you how to edit the xsoftip project to create a simple application that varies the PWM duty cycle. 5.1 Editing the xsoftip code 1. Open the PWM project in the Project Explorer and double-click on main.xc to open it in the Editing window. The main() function created by xtimecomposer is displayed. The par statement is used to instantiate a Core. Each function or statement in a par statement is run on a different core. In this example, two cores will be specified, one core to run the pwm_controller() task and another to run the xsoftip PWM driver. main() has already instantiated your PWM xsoftip, so it will run on one logical core on Tile 1. Now add our own function to run on another core also on Tile 1. 2. Add the code below into the par statement to instantiate a pwm_contoller logical core. on tile [1]: { pwm_controller ( c_pwm_duty ); } The on tile[1] statement is used to specify which tile the processing cores are on. Each tile in an xcore multicore microcontroller has eight logical cores. In this example you will use cores on tile 1. 3. Create a new pwm_controller task above main() in main.xc, that will run on your core using the following code:

xtimecomposer Studio Tutorial 6/11 void pwm_controller ( chanend c_pwm ) { } The task needs a chanend (channel end) so that it can communicate with the PWM Driver. Channel ends are part of the xconnect communication system, allowing the logical cores in a multicore microcontroller to communicate with each other with low latency. xtimecomposer has already created a channel for you: chan c_pwm_duty. Each channel has two chanends, allowing two logical cores to communicate with each other. The PWM Driver has already been given c_pwm_duty as one of its arguments (look in pwm_tutorial_example.xc to see the function definition). From the PWM xsoftip documentation: The PWM component uses 1 Core, with a channel interface to the rest of the application. The client application sends two values over the channel to configure the PWM driver : 1. The PWM period length 2. The PWN duty cycle length All times are measured with the 100 MHz reference clock. For example, a value of 100 is 100 x 10 ns = 1us. In this case we want to configure the PWM with a low time of 5us and high time of 5us. Therefore you need to send it a value of 1000 for the period length and 500 for the duty cycle length. Data is sent over the channel c_pwm using the the <: XC operator. 4. Add the following code to your pwm_controller task: // send the PWM period length c_pwm <: 1000; // send the PWM duty cycle length c_pwm <: 500; The application is now complete and ready to be compiled. 5.2 Building your project 1. Select PWM in the Project Explorer. 2. Click Project > Build Project The Console shows the results of the compilation, together with any error messages. Your Console should show that the build completed correctly. 3. Check the bin folder in the Project Explorer.

xtimecomposer Studio Tutorial 7/11 You now have a binary (PWM.xe) that you can execute. 6 Test your project in the simulator xtimecomposer Studio includes a simulator which allows you to simulate your application without hardware. The simulator includes a waveform analyzer, that you can use to view the I/O pin driven by your PWM xsoftip. 6.1 Run your application in the Simulator 1. Select Run > Run Configurations. 2. Double-click on the xcore Application. This creates a new Run Configuration, automatically filling in the required options. 3. Select Run on: Simulator 4. Click the Simulator tab. You need to enable tracing of the ports so that you can see the I/O pin behavior. 5. Select Enable Signal Tracing. 6. Click Add under Tile Trace Options. 7. Select tile[1] and tick the Ports option.

xtimecomposer Studio Tutorial 8/11 8. Click Run. The application runs on the Simulator. A red Stop button appears in the Console toolbar. 9. Let the program run for about 10 seconds, then click the red Stop button. A PWM.vcd file is added to the Project Explorer. The next section shows how to look at the waveform of your PWM driver.

xtimecomposer Studio Tutorial 9/11 7 The xtimecomposer Waveform Viewer xtimecomposer Studio contains a waveform viewer that you can use to look at the waveform of the PWM signal. 7.1 Using the waveform viewer 1. Double-click on PWM.vcd in the Project Explorer. The Waves window appears in place of the Console. The Signals window appears next to the Project Explorer. You can use this to select which ports to show in the Waves window. 2. Browse to the XS1_PORT_4A port (the port you selected for our PWM port), open the folder and double-click on tile[1]_xs1_port_4a. 3. The Waves window shows the value of the pins for our PWM signal. You may need to zoom out to view the PWM transitions. The PWM driver uses the deterministic, real-time capabilities of xcore to generate a precise PWM signal. The waveform viewer shows a timeline so you can measure the PWM output. 4. Verify the timing of your PWM interface by measuring the period length and duty cycle length of your PWM signal. You can zoom in and out to see the signals with an appropriate timescale. Click on a signal to place a Marker, then move the cursor to view the time difference between the Marker position and the cursor position. 5. Double-click on a transition in the Waves window when the cursor changes to a pointing finger.

xtimecomposer Studio Tutorial 10/11 The output statement that caused the transition is highlighted in the Editor window, allowing you to link the transition to the source code. Thanks to its timing deterministic architecture, xcore multicore microcontrollers provide guaranteed response times up to 100x faster than conventional microcontrollers. xtimecomposer Studio includes the XMOS Timing Analyser (XTA), a tool for analyzing your application and telling you precisely how long your code will take to execute. 8 Next steps Congratulations you have now completed this simple xtimecomposer tutorial and are ready to run it on an xcore multicore microcontroller. We aim to make evaluating and development with our xcore multicore microcontrollers as easy as possible by offering a range of development kits to meet your specific needs. 8.1 Buy a development board Take a look at our xkits at http://www.xmos.com/discover/products/xkits 2. If you re not sure which to choose, we recommend our slicekit Starter Kit 3. 8.2 Try the slicekit Development Board tutorial If you have a slicekit starter Kit we recommend that you follow the slicekit Development Board Tutorial, which shows you how to run the project you created in this tutorial on a hardware board. It also shows you how to use the real-time features of xcore multicore microcontrollers to extend the PWM application to create a temperature controlled LED dimmer. See Help > Tutorials > slicekit Development Board Tutorial. 8.3 Browse xsoftip Take a look at the other xsoftip components. You can read through the documentation in Developer Column, and use them in your project. XMOS and our partners are working on new xsoftip components all the time. Some components you ll see are Roadmap components which are in our development plan. If there is a component you require for your system that is not available, please let us know we d love to hear from you. 8.4 Try some other tutorials We provide a range of tutorials covering the xtimecomposer tools, xsoftip and xkit development boards. See Help > Tutorials for more information. 2 http://www.xmos.com/products/xkits 3 http://www.xmos.com/products/xkits/slicekit#slicekit-starter-kit

xtimecomposer Studio Tutorial 11/11 Copyright 2013, All Rights Reserved. Xmos Ltd. is the owner or licensee of this design, code, or Information (collectively, the Information ) and is providing it to you AS IS with no warranty of any kind, express or implied and shall have no liability in relation to its use. Xmos Ltd. makes no representation that the Information, or any particular implementation thereof, is or will be free from any claims of infringement and again, shall have no liability in relation to any such claims.