XMOS XC-1 Based Audio/Effects Board

Started by markseel, January 17, 2011, 10:00:34 AM

Previous topic - Next topic

markseel

Hey All.  I starting laying out a new board for doing some effects work using the XMOS XC-1.

This device has 64K of RAM, eight cores that operate in parallel, can share memory and can communicate and synchronize with each other using a hardware-based message passing scheme.  Each core is a 32-bit cpu and has tight grained control over I/O pins.  In fact, there's no peripherals on the chip.  Instead you use 'C' and 'XC' (C-like language for XMOS devices) to create peripherals.  XMOS calls it software define silicon.  XMOS has free code available for I2C, SPI, I2S and more.

I bench-marked it by doing multiply/accumulate operations in a loop using 32 bit x 32 bit = 64 bit multiply/accumulate operations; a single core performed 11.5 million MAC's/sec.  Using eight cores I got 92 MMACs/Sec.  I didn't try to optimize or code in assembly so I bet it's possible to squeeze more out of it.  Seems like more than enough of power for effects.  Plus there's plenty pf RAM for delay lines.

So far the board is 1.4" x 1.4" with mounting holes and a 20-pin connector for the XMOS USB/JTAG adapter, one XMOS XC-1 chip, 20 MHz clock circuit (chip runs internally at 400 MHz), power-on reset circuit, program EEPROM, voltage regulator(s), stereo CODEC (8KHz up to 92 KHz sampling rate), eight channel low-speed ADC (for pots and such), and 6 GPIO's.

The board layout should be done soon - I'll put it online then.



RonaldB

Sounds interesting, would love to get a board when your done.

best regards
RonaldB

markseel

XMOS supplies a free Eclipse-based GUI development environment supporting 'C' and 'XC' compiling and debugging via the XMOS JTAG adapter.  It also simulates the XMOS so you can observe the operation of the XC-1's pins that you may be controlling with software - like a logic analyzer.

http://www.xmos.com/design-tools-0

The XMOS USB/JTAG is $49 from Digikey.

http://search.digikey.com/scripts/DkSearch/dksus.dll?Cat=2621880&k=xmos

tommy.genes

Ever since iaresee posted THIS, I've been hoping that someone would develop a project board around a programmable chip (since I never find the time to do such things myself).

If I ever invest the time in learning such a system, I'd rather it be reconfigurable than be a fixed device like an Arduino.

-- T. G. --
"A man works hard all week to keep his pants off all weekend." - Captain Eugene Harold "Armor Abs" Krabs

RonaldB

Hi Markseel,
Will you be selling boards with the XMOS ont them?

best regards
Ronald

PRR

Interesting.

> doing multiply/accumulate operations in a loop using 32 bit x 32 bit = 64 bit multiply/accumulate operations; a single core performed 11.5 million MAC's/sec ...  I didn't try to optimize or code in assembly so I bet it's possible to squeeze more out of it.

Hmmmmm. MS QuickBasic, a very bloated compiler, occasionally emitted VERY tight code. "FOR i = 1 TO 100; i = i + 1; NEXT i" could compile as an ADD and a JNE, two opcode loop. C compilers often do that. I would assume a specialized compiler would be more motivated to reduce frilly-language to tight-code. So don't bet that machine-code will be faster.

10+ million MACs/sec for the price of fast-food is still interesting.
  • SUPPORTER

xmos

#6
Noticed you were discussing the XC1-A development kit. If you have any questions do feel free to ask our community at http://xcore.com - plenty of projects you may be able to reuse source code from too to help you get started. There are also a number of methods currently to win a free development kit there too.

If you would like to learn more in a coffee break, check out some of our videos on YouTube http://www.youtube.com/myxmos hopefully these will be able to demonstrate the types of projects people are working on, and some background to the XMOS platform too.

We would love to know more about the specific projects you have planned, feel free to send me a message or reply here - whichever works for you.

markseel

Quote from: RonaldB on January 18, 2011, 12:28:23 AM
Hi Markseel,
Will you be selling boards with the XMOS ont them?
You bet.  The board will have all parts soldered and tested.
I'd be happy to ship non-populated PCB's (for $5 or so) to people who want to save the money and do the board assembly themselves.

Thanks to XMOS for support!  I've  checked out their forums and there's a lot of good info.


RonaldB

That's great,
Let me now when you are done  :)

best regards

Ronald

mhelin

#9
Quote from: markseel on January 17, 2011, 10:00:34 AM
Hey All.  I starting laying out a new board for doing some effects work using the XMOS XC-1.

This device has 64K of RAM, eight cores that operate in parallel, can share memory and can communicate and synchronize with each other using a hardware-based message passing scheme.  Each core is a 32-bit cpu and has tight grained control over I/O pins.  In fact, there's no peripherals on the chip.  Instead you use 'C' and 'XC' (C-like language for XMOS devices) to create peripherals.  XMOS calls it software define silicon.  XMOS has free code available for I2C, SPI, I2S and more.

I bench-marked it by doing multiply/accumulate operations in a loop using 32 bit x 32 bit = 64 bit multiply/accumulate operations; a single core performed 11.5 million MAC's/sec.  Using eight cores I got 92 MMACs/Sec.  I didn't try to optimize or code in assembly so I bet it's possible to squeeze more out of it.  Seems like more than enough of power for effects.  Plus there's plenty pf RAM for delay lines.

So far the board is 1.4" x 1.4" with mounting holes and a 20-pin connector for the XMOS USB/JTAG adapter, one XMOS XC-1 chip, 20 MHz clock circuit (chip runs internally at 400 MHz), power-on reset circuit, program EEPROM, voltage regulator(s), stereo CODEC (8KHz up to 92 KHz sampling rate), eight channel low-speed ADC (for pots and such), and 6 GPIO's.

The board layout should be done soon - I'll put it online then.

The chip is actually XS1-(some variation), for an example the XC-1A kit uses XS1-G4 device.  There are rumours of XS2 chip coming (not very soon though).  Right now I think using the XS1-L2 chip would be the best choice (that's what XMOS USB 2.0 Audio Design kit uses), have read that the I/O like S/PDIF or I2S consumes quite a lot CPU cycles. Unfortunately it's difficult to solder on the pcb (you need a hot air soldering station at least).

The lowest cost XS1-L1 (I guess this is the chip you are going to use) has one core which supports upto eight threads, but unfortunately using four threads already maxes out the performance. So you'll get the same number of MAC's using four or six or eight threads.  XS1 is quite a different animal, it's more like a FPGA married to hardcore microprosessor (FPGA's usually have a softcore MPU, meaning the microcontroller / CPU is just a FPGA program). I've got the Sparkfuns XS1-L1 board but I'm still learning how it works. Basically you have channels or streams which send events you are processing.

http://en.wikipedia.org/wiki/XCore_XS1

markseel

You're right mhelin, it's the XS1-L1.  As you said, the XC-1 kit uses the XS1-G4 chip (4 cores, eight thread per core) while the XK-1 kit uses the XS1-L1 chip (one core, eight threads).

I have the XK-1 kit.  Only $99.  The USB XTAG (JTAG interface) comes with it and can be used to program/debug any XMOS device.  I'll be including the connections for the XTAG on this effects board so you can use the standard GUI development tools from XMOS to program/debug it and burn programs to EEPROM.  The XTAG can be had for $50 if you buy it separately.

Quote from: mhelin on January 19, 2011, 02:56:27 AM
The lowest cost XS1-L1 (I guess this is the chip you are going to use) has one core which supports upto eight threads, but unfortunately using four threads already maxes out the performance.

I don't think it's unfortunate but rather a well-thought out design choice.  The purpose of hardware threads is not just to scale MIPS performance but also to address the need for hardware concurrency.  Each thread, although having to share a 400 MIPS 32x32=64 multiplier, has the ability to control GPIO independently and synchronize with on-chip or off-chip hardware threads with extremely low latency.  Including multipliers for each core or additional hardware resources to allow the system to scale performance linearly with increasing hardware thread-count would result in larger silicon and higher cost.  So I see this as a balance that allows some cores to go balls out on MIPS while other cores are handling lower MIPS but latency sensitive peripheral activities that can be proprietary and configurable do to fine-grained GPIO control (10 nanoseconds!).

The way it's looking so far some of the XS-1's cores will be handling I2S and SPI duties (audio CODEC communication, pot ADC communication, etc) leaving half or more of the cores available for audio work and additional I/O stuff that someone might want to include.


mhelin

Quote from: markseel on January 19, 2011, 09:41:33 AM
The way it's looking so far some of the XS-1's cores will be handling I2S and SPI duties (audio CODEC communication, pot ADC communication, etc) leaving half or more of the cores available for audio work and additional I/O stuff that someone might want to include.

That's fine, just be sure to check that the GPIO (additional I/O) ports are all 1bit ports (there are only 16 of them available). Too bad there isn't any standard I2S extension pinouts for headers you could use (I guess some people would like to add another DAC or ADC there as additional I/O). For an example the PCB for this DAC is available on BatchPCB, the pinout is standard for Digilent FPGA kits PMOD connector:

http://members.cox.net/ebrombaugh1/synth/audiodac/index.html

I've been let to know that Sparkfun will release this as ready built module later.

mhelin

#12
The Digilent (not Sparkfun) I2S DAC (same as the link in previous post) is already available:

http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,719,859&Prod=PMOD-I2S

Well, Digilent have changed the pinout compared to original design  :icon_twisted:

However, the GND and +3.3V pins are still the same, only clock and data signal changed.


There is also this CODEC board from Mikroelektronika:

http://www.mikroe.com/eng/products/view/484/audio-codec-board-proto/

The A/D input is fixed to monophonic mic input though, not so good if you have a stereo source  :icon_frown:

mhelin

Quote from: mhelin on January 20, 2011, 05:48:48 AM
The Digilent (not Sparkfun) I2S DAC (same as the link in previous post) is already available:

http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,719,859&Prod=PMOD-I2S


Well, considering that XS1 runs at some fixed xcore clock rate (which isn't always synchronous to any common sample rates) to sample or output data from / between internal buffers and ports at discrete time, using this kind of clocking (where XS1 is a master and the DAC a slave) is not a good idea as it will cause jitter.  So it's best to have an external local oscillator for the converters. If there are several converters they should have some kind of common clock generation circuit. Then the XS1 can be run as a slave and the converters (or actually the clock generator) as a master to guarantee the lowest jitter (variation in clock signals). 

markseel

Thanks mhelin for the XMOS GPIO pin usage suggestions.

Cool CODEC boards too.
I like that one from MicroElektronika.
Same CODEC as the one I use in the NextDsp board.

Perhaps I should leave the CODEC off of this board so that people can hook up their CODEC's/ADC's/DAC's of choice.

Anyone else have preferences?

RonaldB

I rather have the codec's on board.
So you have a complete package to bluid projects with.

Ronald

mhelin

#16
Quote from: RonaldB on January 21, 2011, 12:32:27 AM
I rather have the codec's on board.
So you have a complete package to bluid projects with.

Ronald

How about such an alternative that we had the codec on board but also it's clock signals (MCLK, SCLK, LRCLK)  routed to expansion header so that the codec can also function as a clock generator for external (with possibly better quality or just having additional number of IO's) codec or converter?

In that case all of the converters would also share the same clock signals when the built in codec has it's own clock generation (crystal) and runs as master. So if Mark for example will use the same Wolfson WM8731 codec which is ok but doesn't have so good A/D for an example compared to PCM4222 ADC then one could just build an ADC board with PCM4222 on board and run it as slave using the clocks generated by the WM8731.  So the clocks to the expansion header are get from CLKOUT (see below), BCLK and  DACLRC pins of WM8731.

(datasheet: "CLOCKOUT, The Core Clock is internally buffered and made available externally to the audio system on the CLKOUT output pin. CLKOUT provides a replication of the Core Clock, but buffered as suitable for driving external loads. ". Well propably also the BCLK and LRCLK should be buffered. )



markseel

#17
Here's a picture of the PCB layout so far:

http://picasaweb.google.com/mark.seel/NextAudioDigitalAudioSignalProcessor#5565090890081058578

The board is 4 layers and is only 1.0" x 1.2" and will fit on a solderless prototype board for experimentation.
The board contains:

- 400Mhz XMOS XS1-L1 CPU
- Switching 1V regulator for CPU core
- Linear 3.3V regulator for CPU I/O
- Crystal Oscillator circuit for CPU system clock and audio master clock
- Power-on reset delay circuit for CPU
- 20-Pin DIP XTAG interface
- Two rows of 10-PIN SIP's for I/O's and/or plugging into a prototype board (20 PIN DIP with 1" DIP width)
- SPI interface for external program EEPROM

Since it hast the 20-pin XTAG connection you can use XMOS's $50 JTAG interface and the free programming IDE to compile, download, debug, and even burn the program EEPROM.

I took the CODEC and EEPROM off of the board so people can choose their own parts.
Since the EEPROM's chip select is brought out to a pin you could use the SPI bus for other peripherals without consuming other GPIO's for SPI signals (except for chip selects of course).

As mhelin pointed out there's some nice CODEC boards with stereo jacks that could be hooked up easily.  Can't wait to try that out!

I still have to check for errors but it's pretty close to done.
I'll bring up a web-site soon for instructions, PCB files, hook-up examples, programming examples in the next couple of weeks.
I can build and test a board for around $30 to $40.

Sorry about the cost!  Building one myself takes time (I'm not very fast at soldering SMT parts and I can't work for free!) :icon_biggrin:
Or you can build it yourself - you can buy just the board for say $5.00 and reference the bill-of-materials and parts placement diagram on the website (coming soon).

markseel

Here's an update!  :icon_biggrin:

The first board is 4 layers (ground, 1.0V, 3.3V, signal) and is 1" x 1.05".  It can be used as a 1" wide DIP module by populating it with two 10-pin SIP on each side and 1 9-pin SIP at the top for the JTAG debugger.  A 9-pin sip can be added to the bottom for more GPIO's.  The board contains the XS1-L1 64-pin CPU, the 1.0 volt switching regulator for the CPU core, a power-on reset delay circuit to prevent reset from being de-asserted before the 1.0 volt supply is stable, and a clock circuit for the CPU's PLL.  The PCB layout is here (only the top layer is shown since it has nearly ALL of the signal traces):

https://picasaweb.google.com/mark.seel/NextAudioDigitalAudioSignalProcessor#5568003700363931602

The board doesn't include peripherals such as the EEPROM, CODEC, etc.  These can be hooked up easily using a solder-less bread-board (which I'll do after I make some test boards).

In the near future I'll lay out an effects board that accepts this 38-pin CPU module and has an EEPROM, audio ADC's and DAC's, low speed ADC's for pots, and the XTAG 20-pin connector.



markseel

I uploaded pictures of an operational board and the next revision of the PCB layout.

The board has some issues and had to be manually reworked a bit so it's a little messy.

The original design had a silicon oscillator rather than a crystal-based oscillator.  Bad call.  Jitter was terrible.  Kludged in a crystal oscillator and now the clocks are rock solid!

I have code to perform I2S and I tested it with some ADC's and DAC's.  Starting to work so I don't for see any problems here.

Can't wait to do some audio DSP and some guitar effects.

I'll be posting the board's Gerbers and XC source code soon.