Go Down

Topic: Arduino (ATmega328) + XMOS 400Mhz Chip = Audio Heaven (Read 6581 times) previous topic - next topic

WilliamK Govinda

Here's a very crazy idea I had the other day, which I still don't know if its doable or not...

To combine a regular Arduino and a XMOS chip. (www.Xcore.com - www.Xmos.com)

The cheapest one does 4 x 100 Mhz threads (you can't have a single 400 Mhz thread sadly) or 8 x 50 Mhz Threads. Its 32 bits with 64 bits accumulators (no idea on how to use those yet) 64 Kb of RAM (used by the program + variables, AFAIK) and can auto-boot from an external SPI Flash.

Here's a single chip on SparkFun: http://www.sparkfun.com/products/10109

The idea is to make the Arduino board talk to the XMOS chip telling what to do, plus, also upload the data to the SPI Flash, so it wouldn't require any extra tools to program the XMOS chip. Unless the user wanted to really mess around with the chip, then a "XMOS XTAG2 Debug Adapter" would be required.

Here's a thread about how to start-up with those chips: https://www.xcore.com/forum/viewtopic.php?f=3&t=1429

And here are a couple of PDF file that talks about the basic structure on how to setup the chip.



So, usually those chips use a thread for UART, another for PWM which would kill the whole chip for those simple things. BUT, since the ATmega328 will be taking care of this, we would use the XMOS chip only for 32-bit math, and let the ATmega328 (Arduino board) take care of the rest. ;-)

So, the block-diagram would be simple. One timer we call at X samples, that will do the 10bit PWM, like we did on the BeatVox project: https://github.com/Beat707/BeatVox

Once the timer calls the interrupt, it will set the PWM of the two outputs to a previously saved variable, just like the BeatVox = 1 sample buffer delay.

After that, it will send data to the XMOS chip telling what was changed in terms of parameters, send MIDI data and ask for the last processed sample buffer, store, and rest. After that the XMOS chip will calculate the next buffer using all its power-magic.

Of course we could later add a 16-bit DAC to the process, and maybe even have the XMOS chip itself handle that or a better PWM. (couldn't get it to work so far)

All in all, this is just an idea for now. I have the XC1A kit which is great for doing tests, and once I have something that works, I will start posting code. But I will do this slowly, as I wonder if the new Arduino DUE (96 Mhz ARM 32-bits) wouldn't be just easier to handle, still with less power compared to 4 x 100 Mhz Threads, but still, we will see I guess.

Best Regards, WilliamK

WilliamK Govinda

Here's another idea, the XMOS chip boots from an external SPI Flash, it has its own Bootloader already in the chip ROM, all you need is to setup the MOSI/CLK/MISO/SEL and adjust the pins so the chip knows it should boot from the SPI Flash.

Now, not sure how possible is this, I'm checking on the XMOS forum if the people there could help me with this or not.

The XMOS chip has 64K of RAM which is also used by the code, so the whole program can't be larger than 64K.

Imagine an Arduino Mega 2500, it has a lot of Flash space. When it powers up, by default, it acts as a SPI Slave, first, the XMOS chip will request the data, it sends the binary data for the XMOS program, then after that's done, it exits the SPI Slave mode and starts running. That's all simple to do, the only part that is more "hard" per-say, is to convert the XMOS binary data to C code so you can add to your Arduino project.

This way, a XMOS Shield would be very simple and no extra hardware would be required to program the XMOS chip by Arduino user.

Its all crazy ideas, not sure if I will proceed with this, unless people think that adding this 400 Mhz extra power would help or not. ;-)



That would give a huge increase of power.

in the frame of thinking about something that fits here - like a powerfull Arduino driven synth - I think it would be better than the DUE: not only you have more computing power, but in this case you can dedicate the computing power to synthesis. There's nothing more annoying in the end than sharing computing power between Audio processing and managment of MIDI UART + synth state.

shall the Arduino, whichever the version, be dedicated to Midi Managment and Synth / System state, the 400 Mhz could be used for audio pipelining/synthesis, without struggling with IO interruption. In this case you're good to go with a simple versatile Audio plattform + complex synthesis engine.

Damn, you're right that sounds good!
Blog, DIY Electronics & Stuff - http://www.banson.fr


The Xmos chips are pretty cool. I've been using them on and off for the last couple of years.

Xmos have found their niche market in audio processing, lots of design-ins for ipod docking stations, USB audio and AVB Ethernet. So the they would make a great shield for the Arduino.

There's already been several attempts at building a Xmos shield for the Arduino:


WilliamK Govinda

I'm glad I could get your attention on this. ;-)

Maybe I will order the SparkFun XMOS board and remove the SPI Chip (I think it has one) and re-route some pins to test this out. ;-)

Or, if someone could give me a hand, we could just create the shield directly or some sort of prototype that would have the power-regulators and the XMOS chip routed to the Arduino SPI pins.  :smiley-mr-green:

We talk more in a few days, once I get my head on this.


WilliamK Govinda

The Xmos chips are pretty cool. I've been using them on and off for the last couple of years.

Thats great news. I really wish I could find an easy to adapt 16-bit DAC/Codec to the XMOS, but so far I couldn't figure out what to use...



... I really wish I could find an easy to adapt 16-bit DAC/Codec to the XMOS, but so far I couldn't figure out what to use...

What 16-bit DAC/Codec are you thinking of using?

Go Up