XCARD XC-1 XMOS, XCARD XC-1 Datasheet

BOARD DEV KIT XS1-G4

XCARD XC-1

Manufacturer Part Number
XCARD XC-1
Description
BOARD DEV KIT XS1-G4
Manufacturer
XMOS
Series
XCore™r
Type
MCUr

Specifications of XCARD XC-1

Contents
Board, Cable
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
For Use With/related Products
XS1-G4
Other names
880-1013
XC-1 Development Card Tutorial
(V
9.7)
ERSION
2009/08/11
Authors:
XMOS L
.
TD
Copyright © 2009, XMOS Ltd.
All Rights Reserved

Related parts for XCARD XC-1

XCARD XC-1 Summary of contents

Page 1

... XC-1 Development Card Tutorial 2009/08/11 Authors: XMOS Copyright © 2009, XMOS Ltd. All Rights Reserved (V 9.7) ERSION ...

Page 2

... The XMOS originated XC language [1] is based upon C, providing additional constructs that simplify control over I/O operations, time and concurrent be- haviour. The XMOS design tools support XC and C, allowing complete systems to be built and debugged from within a single development environment. This tutorial provides an introduction to start developing for Event-Driven Pro- cessor devices using features of the XC-1 and the XC language ...

Page 3

... XMOS are intended to illustrate how particular language constructs simplify the imple- mentation of Event-Driven Processor designs. The examples in this tutorial apply to version 9.7 of the XMOS Design Tools. Information on downloading, installing and using these tools is provided in the Development Tools User Guide [3]. 2 Illuminate an LED: This part of the tutorial shows you how to use XC ports and an output statement to illuminate the LEDs on your XC-1 ...

Page 4

... XMOS Ports are used to transfer data to and from the pins on the processor, thereby interfacing with external components. Integrated input and output XC statements make it easy to express I/O operations on these pins. main The first statement in bled <: 0x10; The value specified to the right of bled ifi ...

Page 5

... XMOS I II III IIII X0D15 X0D20 X0D21 X0D2 X0D3 PORT_CLOCKLED_2 PORT_CLOCKLED_0 Figure 1 Schematic for the 12 bi-colour clock-LEDs on the XC-1 #include <platform.h> out port cled0 = PORT_CLOCKLED_0; out port cledG = PORT_CLOCKLED_SELG; out port cledR = PORT_CLOCKLED_SELR; int main(void) { cledG < disable GREEN line cledR <: 1; ...

Page 6

... XMOS 0xf the pattern to PORT CLOCKLED 0, PORT CLOCKLED 1 and PORT CLOCKLED 2). 3 Flash an LED: timer This part of the tutorial shows you how to use an XC timer with an input state- ment to flash an LED green-red. Timers are a special type of port that, when input from, return the current time. ...

Page 7

... XMOS out port cledR = PORT_CLOCKLED_SELR; int main(void) { timer tmr; unsigned ledGreen = 1; unsigned t; tmr :> t; while (1) { cledG <: ledGreen; cledR <: !ledGreen; cled0 <: 0x1 FLASH_PERIOD; tmr when timerafter(t) :> void; ledGreen = !ledGreen; } return 0; } Compile and run this program on your XC-1. A single clock-LED should flash green-red. ...

Page 8

... XMOS select The statement in the following example waits for one of two timeouts to occur and then responds to this timeout: select { case tmrF when timerafter(timeF) :> void : / * respond to timeout, * switch LED between on and off * / ... break; case tmrC when timerafter(timeC) :> void : / * respond to timeout, * change which LED is flashing * / ... break ...

Page 9

... XMOS tmrF :> timeF; tmrC :> timeC; while (1) { select { case tmrF when timerafter(timeF) :> void : ledOn = !ledOn; cledG <: ledOn; timeF += FLASH_PERIOD; break; case tmrC when timerafter(timeC) :> void : cled0 <: ledVal; cled1 <: (ledVal >> 4); cled2 <: (ledVal >> 8); ledVal << (ledVal == 0x1000) ledVal = 1; timeC += CYCLE_PERIOD; break return 0; ...

Page 10

... XMOS par The statement provides a simple way to execute multiple statements as separate threads in parallel. In the following example, two functions are called concurrently: in port buttons = PORT_BUTTON; out port speaker = PORT_SPEAKER; int main(void) { par { cycleLED(cled0, cled1, cled2, cledG, cledR, FLASH_PERIOD, CYCLE_PERIOD); buttonListener(buttons, speaker); } return 0; ...

Page 11

... XMOS } } The pinsneq function causes the input to wait until the value sampled on the pins is not equal to the bit pattern four buttons was pressed. The and zeros to the speaker at the frequency specified by the delay, for the specified period of time. This causes the speaker to emit an audible tone. ...

Page 12

... XMOS return channel consists of two channel ends, the locations of which are implicitly de- fined by the use of the channel in two statements explicitly referred function parameter using the for example: void buttonListener(in port b, out port spkr, chanend c); The XC input and output operators can be used for channels the following example: c < ...

Page 13

... XMOS START Bit Figure 2 UART Transmit Procedure on your XC-1. Pressing a button should change the colour of the flashing LED as well as producing an audible tone. Note: No two threads may attempt to write to the same variable in parallel; all communications require the use of channels. This restriction prevents common programming errors such as race conditions, and ensures that the two threads can be run on any two cores, regardless of whether they share memory ...

Page 14

... XMOS void txByte(out port TXD, int byte); out port TXD=PORT_UART_TX; int main () { return 0; } void txByte(out port TXD, int byte) { unsigned time; timer get initial time * / t :> time send start bit * / TXD <: 0; time += BIT_TIME; t when timerafter(time) :> void send data bits * / for (int i=0; i<8; i++) { TXD < ...

Page 15

... The XC-1 has a chip that performs a USB-to-serial conversion. When the card is connected using a USB cable, this chip presents a virtual COM port that can be interfaced using a terminal emulator. For your convenience, XMOS has uploaded a sample terminal listener to the Xlinkers community website Event-Driven Processor programs, related software and reference designs. ...

Page 16

... XMOS CORE 0 Button Channel c Listener Speaker Channel d Listener Figure 3 Thread diagram for a multicore program in which a button listener interfaces with a speaker listener using the UART protocol. Implement a main function that transmits “Hello World!” over a serial link (PORT UART TX). Compile and run this program on your XC-1 while running a terminal emulator connected to the virtual COM port installed by the XC-1 ...

Page 17

... XMOS 1B 1A X2PortA Figure 4 One of the through-hole prototyping areas on the XC-1. To complete this example, you need to solder a jumper connector to pins 1A and 1B. To complete the exercises in this section you need to solder a jumper connector through two holes on the XC-1, as illustrated in Figure 4. To get started, you need to to include the header file provides a declaration of the global variable in this case an XS1-G4 ...

Page 18

... XMOS main Note: When is used with par single statement and an optional buttonListener Modify the a tone value to a channel when a button is pressed. (Note: Do not send the delay value directly since this value is larger than a byte.) transmit Implement a sends them over a serial link using the tion 7 ...

Page 19

... XMOS XCORE0 PORT_BUTTONLED [A:D] PORT_BUTTON [A:D] PORT_CLOCKLED_0/1/2 PORT_SPEAKER PORT_UART_RX PORT_UART_TX EE2 mUSB-B FTDI RST PGOOD PWREN# 3V3 PSU 1V 5V Figure 5 XC-1 Block Diagram XC EVELOPMENT ARD UTORIAL XCORE2 X2PortA Header X2D0 X2D1 X2D2 X2D3 X2D4 X2D5 3V3 GND X2D6 X2D7 X2D8 X2D9 ...

Page 20

... XMOS Ltd. XC-1 Hardware Manual. Website, 2009. xmos.com/published/xc1hw [5] David May. XMOS XS1 Architecture. Website, 2008. xmos.com/published/xs1-87 [6] David May and Henk Muller. XMOS XS1 Instruction Set Architecture. Web- http://www.xmos.com/published/xs1inst87 site, 2008. [7] David May and Ali Dixon and Ayewin Oung and Henk Muller. ...

Page 21

... XMOS Ltd is the owner or licensee of this design, code, or Information (collec- tively, 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 implementa- tion thereof will be free from any claims of infringement and again, shall have no liability in relation to any such claims ...

Related keywords