News:

SMF for DIYStompboxes.com!

Main Menu

Simple DSP II

Started by markseel, November 25, 2012, 09:31:06 PM

Previous topic - Next topic

markseel

Here's my latest digital effects project.  It's a small 0.8" x 2.0" PCB with an XMOS XS1-L1 (400 MIPS), a stero CODEC (24-bit 48kHz), high impedance input buffers, and a Bluetooth Low Energy radio module.  The PCB's are in so I'll be populating a couple with parts and testing over the next few weeks.  Firmware for handling audio processing and Bluetooth communications is about half done.

The PCB has connections for the XMOS JTAG (XTAG) so you can link with my firmware library and download your own effects programs.  The firmware handles Bluetooth communications and audio I/O so that you can simply write some audio processing code, compile/link/download, and listen!  The audio flow from the ADC through the audio processing loops to the DAC as well as the transfer of effects paramers from updates via Bluetooth are both taken care of by the code I'm writing so it should be really easy to add you're own audio processing code to each audio processing stage.

I'm also writing a sample effects chain that includes compressor and noise gate, up-sampling, overdrive with parametric EQ's in front of each gain stage, down-sampling, graphic EQ, and finally a chorus.  In the end there's either my effects loop that people can configure over Bluetooth or empty audio loops that programmers can use to add their own effects and then use Bluetooth to configure/change them.

I also have a Python script that allows you to update the board with effects parameters/adjustments using a Bluegiga BLED112 USB dongle.

All of the PCB design files, firmware libraries and PC software is available to whoever wants them - I'll get them on a website soon otherwise just send me a message nd I'll email them to you (after they're done).

Here's a link to the "Simple DSP II - System Overview" PDF.

https://www.dropbox.com/s/6uldknfbi9efysv/SimpleDSP2%20-%20System%20Overview.pdf

markseel

#1
The PCB:

RonaldB

Looks very cool.

looking forward to this.

ROnaldB

SISKO

Excellent work!

Will you be selling this? Any toughts about the cost of it?
Could it be interfaced with and external type of memory in order to build a delay?
--Is there any body out there??--

markseel

#4
Quote from: SISKO on November 26, 2012, 04:57:44 PM
Will you be selling this? Any toughts about the cost of it?

Bill of Materials estimate for small quantities...
PCB - $2
XMOS XS-1 L1 LQFP48 - $7
Bluegiga BLE112 - $30
AK4556, OpAmp, passives - $7
Crystal, EEPROM, Vregs, POR, passives - $12
TOTAL - $60

Quote from: SISKO on November 26, 2012, 04:57:44 PM
Could it be interfaced with and external type of memory in order to build a delay?

The XS1 has 64 KB RAM shared between program and data.  My firmware will consume around 5K.  A delay effect probably wouldn't consume more than a couple KB for program code. That leaves well over 50 KB of RAM.  At two bytes per sample (16-bit fractional fixed point rather than 32-bit fixed point) that's 25 Ksamples.  At 48 KHz sample rate the max delay would be around 520 milliseconds.

If you're OK with lower fidelity you could down-sample before the delay line then up-sample afterwords. Down-sampling to 24 kHz would bring the max delay to over one second but with a reduced signal bandwidth (12 kHz).

You can add external memory (even D-RAM) to an XMOS MCU but it takes code (driver).  So maybe a future version ...

markseel

#5
I have a Python script to use Bluetooth Low Energy to communicate with the board. But since it's standard Bluetooth a smart phone or tablet could be used to control it.  Here's a mockup for the iPhone showing:

Screen 1 - The discovery screen used to discover boards that are available for connection.
Screen 2 - The list of effects for a board that's been connected to.
Screen 3 - The list of parameters for a selected effect for the currently connected board



Anyone know iOS app development?

markseel

Quote from: markseel on November 26, 2012, 09:26:49 PM
Bill of Materials estimate for small quantities...
PCB - $2
XMOS XS-1 L1 LQFP48 - $7
Bluegiga BLE112 - $30
AK4556, OpAmp, passives - $7
Crystal, EEPROM, Vregs, POR, passives - $12
TOTAL - $60

The BLE112 is only $17.50 from Mouser.  So board cost would be less than $50.

mhelin

Excellent indeed. Btw. the XMOS XTAG is these cheaper than it used to be, only $19 at Digikey:

http://www.digikey.com/product-detail/en/XCARD%20XTAG-2/XCARD%20XTAG-2-ND/2183686

How about BLE dongle, does it work with others BT 4.0 LE compatible dongles?

Regarding the delay using something like ADPCM to lenghten the delay time should work fine with guitar signal (not much harmonics unless generated on purpose). Also lower sampling rate is fine, I think Line6 Pod used 30 kHz sample rate.

markseel

Here's links to some source code files.

"nextmos.h" - Header file that provides the framework for adding your own effects that can be discovered, described and controlled via the Bluetooth interface.
"starter.c" - 'C' file containing example algorithm definition/description structures.  These should be changed to reflect information specific to your own algorithms.
"starter_.xc" - 'XC' file containing example algorithm functions.  These just pass the inputs to the outputs without any processing.  You can add processing code here.

I'll post the object files ("nextmos.o" and "nextmos_.o") for the firmware that handles the CODEC, Bluetooth, and audio sample and parameter adjustment transfers soon.

https://www.dropbox.com/s/t94z1do76e9vaf2/nextmos.h
https://www.dropbox.com/s/lxicmekmc65m0yg/starter.c
https://www.dropbox.com/s/4zrc2uepmnd2h4o/starter_.xc

To build an effects chain consisting of the 'starter' files using the XMOS command line tools (free from XMOS):

c:\xcc -O2 nextmos.xn nextmos.o nextmos_.o starter.c starter_.xc -o starter.xe

The "starter.xe" file is the XMOS firmware image file to be loaded into the boards FLASH memory using the XTAG JTAG board (using the XMOS download tool).

Upon reboot of the board your effects would be running and the board would be ready to accept adjustments via Bluetooth Low Energy.


markseel

Quote from: mhelin on November 27, 2012, 06:06:15 PM
How about BLE dongle, does it work with others BT 4.0 LE compatible dongles?

Any device that's capable of the Bluetooth Low Energy Central Role (a Bluetooth device that is able to scan for BLE devices and establish BLE connections) can be used.  This includes pretty much all Bluetooth Low Energy (Dual Mode - Classic and Low Energy, Single Mode Low Energy) devices found in Android phones, Apple iPhone 4S and iPhone 5, iPad 3 and iPad Mini, and PC's/Laptops supporting Bluetooth Low Energy.

There needs to be an application written to control the BLE device in order to initiate scanning, connect to devices that advertise themselves to be a 'nextmos' board, and to interact with the board using the Bluetooth Low Energy GATT protocol.  Android and iOS have standard libraries for this.  PC applications (Windows XP, Vista, 7) have to target a specific Bluetooth Low Energy Device using that devices API (DLL's) and driver files.  Not sure about OS X - Pretty sure that you'd use the CoreBluetooth framework just as you would in an iOS device.

My Python script (running on a Windows PC) uses the Bluegiga BLED112 device.  This device looks like a serial device (virtual COM port) and is communicated via a UART interface.  The Python code should run on Linux and OS X since the BLED112 appears as a virtual COM device and therefore doesn't depend on a device specific USB-based driver.  Many other Bluetooth (Classic and Low Energy) devices on PC's require you to use that devices DLL's that present a device specific API.  I think this will change for Windows 8 such that there would be an OS-level standard way of doing Bluetooth (just like there is for iOS and OS X).

For now the easiest way to control Bluetooth Low Energy peripherals (like the XMOS board) via a Bluetooth Low Energy central (like a phone/tablet/laptop/PC) is to either use the CoreBluetooth framework on iOS/OSX or use a UART-based dongle (like the BLED112) since it doesn't require device specific drivers/libraries.

mhelin

#10
Ok,

BLED112 seems to be using Texas CC2540 chip so it's also compatible with TI software (including BLE sniffer, any ideas how to find out which protocol the "Full HD 3D Glasses Initiative" compatible shutter glasses use, would like sync them with my Optoma pj with VESA sync out?).

There is also API for Android:

http://code.google.com/p/broadcom-ble/

Don't know if it's only for Broadcom devices or all others as well.

E: Bluegiga seems to be using their own stack, not TI's:

http://blog.bluetooth-smart.com/2011/10/05/bluetooth-low-energy-development-kits-2/

BLE112 can also be programmed using the BGScript (from the same blog as above):

http://blog.bluetooth-smart.com/2012/09/16/programming-the-ble112-using-bgscript/

Anyway, The BLED112 don't seems to be available in Europe from here (from Poland to be exact):

http://www.tme.eu/en/katalog/bluetooth-modules_113196/


markseel

#11
Just wondering ... would it be a good idea to make a version of this board that replaces the Bluetooth radio with a USB connector and USB/Serial converter to allow people to use the board as a USB-attached device that looks like a serial device?  You'd then perform the effects information queries and parameter updates using UART-based PC software.

SISKO

Certanly it would be a good idea. All the adds-on would be great! But honestly, I dont think it would be worth the time spent (having already made the bluetooth board).

I would be very happy just by tweaking the parameters with a potentiometer, and its not a bad thing to be simplistic (Im thinking about the FV-1 wich has pots)

I really like the idea of innovating with devices and the BLED112 would be a new thing to try for me, and Ill be excited for that. But first I would like to have my DSP algorithm working, then I would go for the BL´s controls.

And I must say Sir, you are waaay over most of us here. Youre a kind person for sharing your knowledge wuth us and bringing new projects.
--Is there any body out there??--

markseel

#13
I realize that some of this stuff (especially DSP) might be advanced for some - please feel free to ask questions!  :icon_biggrin:

I gave this some more thought.  I'm going to continue to prove out the existing board in the next couple of weeks and then post the PCB artwork and updated firmware files.  But I decided that I'll follow this board up with a 28-pin DIP that only has the XMOS stuff and the audio section (CODEC and analog interface circuitry) on it - no Bluetooth module.  That way we can use the DIP for other projects.

Here's what I'm thinking ... the firmware files will be split out into a core library (DSP functions, CODEC control, audio sample and parameter data flow), effects library (I'll supply mine and anyone can write their own), and separate libraries for effect control and display functions.  So if you use the BLE112 Bluetooth module you would include that library.  Or if you decide to use a bunch of pots then you would include a different library.  Mix and match hardware and libraries for different effects box arrangements!

Possible libraries include BLE112 control (nextmos-ble.o), 8-input 10-bit ADC for eight potentiometer control (nextmos-pots), rotary encoder control using up to three encoders (nextmos-encoders.o), graphics LCD/OLED display from 4DGL (nextmos-4dgl.o), multi-digit 7-segment LED display (nextmos-7segment.o), and PC-based testing using WAVE files for input data and resulting output data (nextmos-wavefile.o).

System Functionality        Required Hardware Components               Requred Firmware Files

Base Functionality          SimpleDSP2 28-Pin DIP                      nextmos-core.o, nextmos-core_.o
Effects Algorithms (Next)   SimpleDSP2 28-Pin DIP                      nextmos-effects.o, nextmos-effects_.o
Effects Algorithms (Yours)  SimpleDSP2 28-Pin DIP                      your-code.xc, your-code_.c
PC WAVE File Input/Output   XMOS XTAG USB/JTAG Device                  nextmos-wavefile.o, nextmos-wavefile_.o
Bluetooth Control           BLE112 Bluetooth Low-Energy Module         nextmos-ble112.o
Encoders Control            Three Rotation Encoders                    nextmos-encoders.o
Potentiomers Control        SPI-Controlled 10-bit ADC, up to 8 pots    nextmos-pots.o
4DGL Graphics Display       4DGL Graphical Display (UART interface)    nextmos-4dgl.o
8-Digit 7-Segment Display   SPI-Controlled 8-digit 7-segment display   nextmos-7segment.o

So to use eight pots for control and a graphical display you would hook up the 28-pin DIP to the ADC and to the LCD module and then compile your project like this:

xcc nextmos.xn nextmos-core.o nextmos-core_.o nextmos-pots.o nextmos-4dgl.o your-effects.o your-effects_.o -o your-effects.xe

The 'your-effects.xe' is the firmware image that you burn into FLASH.  After that reboot and you're done!

markseel

Here's the PCB.  It's two layers, 1.4" x 0.9", 0.8 mil DIP.

The top left 6 pins are the CODEC's analog supply, ground, stereo input, and stereo output.  The top right 7 pins are the XMOS JTAG connector for downloading and debugging firmware.  The bottom 14 pins are I/O pins used to interface to control and display peripherals.


SISKO

Quote from: markseel on December 02, 2012, 09:00:35 PM
I gave this some more thought.  I'm going to continue to prove out the existing board in the next couple of weeks and then post the PCB artwork and updated firmware files.  But I decided that I'll follow this board up with a 28-pin DIP that only has the XMOS stuff and the audio section (CODEC and analog interface circuitry) on it - no Bluetooth module.  That way we can use the DIP for other projects.

Excelent idea! I think this new layout is more versatile and diferent users cand make their own ways to use implements new ideas! Great!
--Is there any body out there??--

alparent

Amen to the Bluetoothless version.
I know nothing about DSP and wouuld like to get my feet wet.
And the usb version would be cheaper to start with.

Man I wish I could understand half of what I read in this thread!  :icon_redface:

mhelin

As a memory expansion for longer delays / looper this SPI MRAM (magnetoresistive RAM) chip could be used at least with the bluetoothless module:

http://uk.mouser.com/ProductDetail/Everspin-Technologies/MR25H40CDC/?qs=sGAEpiMZZMsSm7LhMeloEPcGBwqnPuOP

Datasheet:
http://everspin.com/PDF/EST_MR2xH40_prod.pdf

It contains 512 kbytes (4 mbits) of MRAM. MRAM is expected to replace SRAM, it's as fast, consumes less power (handy for mobile phones) and non-volatile.

markseel

Wow, that's a cool part.  Maybe I should add it to the board ...

Actually we could use that part to replace the FLASH part that stores the firmware and dedicate 64K to firmware and 448K to delay RAM.

512 Kbytes is a lot or memory.  Even at 48kHz sampling rate you'd get over 5 seconds of delay (16 bits/sample).

markseel

Well, I populated a board but it's not up and running yet.
But these recent posts got me thinking about the design a bit.
I hate to waste this last board production run but I'm thinking of a few changes.

In the spirit of "Simple DSP" ...

0.6" x 1.2" SIP Board with a single 12 pin header.

Features: 500 MIPS processing, on-board voltage regulators, high performance audio CODEC, 4 high-speed 12-bit ADC inputs for pots to control effects, USB interface for effects uploading.

Components: XMOS XS1-SU1 500 MHz CPU with 64K RAM and USB, AK4556 24-bit Stereo CODEC, 512K Extra Memory for Delay, and Voltage Regulators

Pinout is as follows:
Pins 1-4: Potentiometer inputs
Pins 5-6: USB data lines
Pins 7-8: Ground and Power (3.4V to 10V)
Pins 9-12: Stereo inputs and outputs

I'll post the PCB layout soon.