This guide describes how to integrate a SigmaDSP processor into microcontroller-based systems.
Microcontrollers are available in a wide variety of architectures and capabilities, so rather than creating a fully-featured SigmaDSP library for every processor, we focus here on the principles behind successful SigmaDSP integration so that users can complete designs quickly and efficiently.
Arduino-compatible example code, attached below includes a simple program to boot ADAU1701, ADAU1761, or ADAU1467 processors without any modification. It is written for the Teensy 4.0, so pin assignments should be adjusted for use on other platforms. Teensy 4.0 was chosen because it is easy to use and has enough memory to store even the largest SigmaDSP program. Version 1.1.0 of the code is also tested and working on ESP8266 (with minor changes described below).
This guide takes advantage of C++ header files generated by SigmaStudio which reduce complexity in users' code.
Example Code Version 1.1.0: teensy_sigmadsp_example_project_1.1.0.zip
byte register_value[dataLength] = {};
. For ESP8266 compatibility, it should be byte register_value[dataLength];
. This fix will be in the next release.Example Code Version 1.0.0: teensy_sigmadsp_example_project_1.0.0.zip
All current SigmaDSP processors are equipped with I2C and SPI control ports. Connecting your microcontroller to one of the control ports allows you to download a SigmaDSP program, read/write registers, and update program parameters on the fly.
SPI is the fastest protocol for communicating between a microcontroller and SigmaDSP processor. Depending on your chosen SigmaDSP the SPI SCLK frequency can be set as high as 20 MHz. It requires four pins on your microcontroller, preferably a hardware SPI port; software SPI implementations are possible but will typically incur high overhead on a microcontroller.
I2C is a slower protocol. Most SigmaDSP processors support a maximum SCL frequency of 400 kHz, although ADAU146x processors are specified up to 1 MHz. I2C requires two pins on your microcontroller, preferably a hardware I2C port; software I2C implementations also incur some microcontroller overhead.
There are many other reasons why either I2C or SPI might be more suitable in your device. For simplicity we won't go into those reasons here. If you are not sure which to use, go ahead and post a question in the EngineerZone support forum. If you describe your application we can guide you through your choice.
In the example code you can switch between I2C and SPI code by toggling #define USE_SPI in USER_SETTINGS.h. To save memory, code for the unused interface will be excluded by the compiler.
All SigmaDSP evaluation boards are outfitted with a 10-pin connector for programming. The connector mates with a USBi programmer (included with all evaluation boards) using the pinout shown here. The USBi connector is also the best way to connect a microcontroller to your evaluation board.
USB_CLK is not a required signal for SigmaDSP development boards, so it is usually left as an open circuit.
Please reference the schematics for your evaluation board's User Guide, which can be found on its product webpage, to determine which interfaces are exposed on connectors. Also note whether your evaluation board includes pull-up resistors on the SCL, SDA, and /SS pins; if they are not present, you must add them.
The EVAL-ADAU1701MINIZ schematic shows that only I2C is available on the programming header (pins 1 and 3). Additionally, there are no I2C pull-up resistors shown in the schematic so they must be provided by your own hardware. The header also includes a reset pin (pin 6) and 5V power pin (pin 4). In the example code ADAU1701 is referred to as a “Sigma100” processor.
The evaluation board uses 3.3V logic levels. Level shifters are recommended for interfacing with 1.8V or 5V microcontrollers.
The 5V power pin (Pin 4) can be connected to your microcontroller's VUSB pin if sufficient current is available. Be careful not to exceed 500mA total current draw from a USB port.
The ADAU1761 (referred to as Sigma200) has a similar pinout to the ADAU1701, although I2C pullup resistors are already in place on the board. The evaluation board schematic is available here.
EVAL-ADAU1761Z also allows Pin 4 of the USBi connector to power the DSP. Again, ensure that your system consumes <500mA from a USB port.
ADAU145x and ADAU146x processors (also referred to as Sigma300 and Sigma350, respectively) expose communications pins as SPI. Since these processors multiplex SPI and I2C interfaces the header can also program the board over I2C (See the “Example Schematic” section for more information).
Note that Pin 4 of the USBi connector illuminates an LED but does not supply power to the entire board. ADAU145x and ADAU146x processors should be powered through the barrel jack.
The following schematic based on the Teensy 4.0 microcontroller allows programming of SigmaDSP processors through the USBi programming header and was used for development of the example code. Please click the image to see a full-resolution version.
Notice that the SCL and SDA connections are duplicated on the header:
This is because some SigmaDSP development boards connect the I2C interface to the USBi (e.g., ADAU1701), where others connect the SPI interface (e.g., ADAU1466). Connecting I2C to Pin 1 and Pin 3 allows programming of the former; and, including both SPI and I2C connections allows either protocol to be used for the latter.
The same is true for the microcontroller:
This configuration connects the SPI and I2C interfaces of the Teensy to each other. If the unused interface is turned off (tristated) in software, this allows the Teensy to choose which communications protocol to use without changing hardware. This functionality is included in the example program.
Microcontroller memory is often in short supply. By configuring the SigmaDSP processor to self boot from an external EEPROM, most of the SigmaDSP program can be excluded from your microcontroller code. However, there are some considerations and common pitfalls to take into account before making this decision:
The example code is separated into the following files:
main.cpp
: The main program body, which initializes hardware libraries and contains user flowUSER_SETTINGS.h
: User-editable configuration variables; use this function to change such things as DSP type, communications protocol, and SPI/I2C transfer speedSigmaStudioFW.h
: User-editable functions to communicate with the DSP. This file is required by SigmaStudio export files.The example code requires some files exported by SigmaStudio which describe the contents of the SigmaStudio project, including register values and parameter locations.
Most applications do not require these files to be altered.
your_project_name_IC_1.h
: Contains default control register addresses and values, as well the default_download() function used to program the DSP. The default_download() function executes the exact same flow as “Link-Compile-Download” in SigmaStudio.your_project_name_IC_1_PARAM.h
: Contains useful information about algorithm parameters.your_project_name_IC_1_REG.h
: Contains similar information to the _PARAM.h file above, but for control registers instead of algorithm parameters.SigmaStudio also exports the following files which are not used by the example code.
your_project_name.params
: A human-readable description of each parameter in the SigmaStudio project.your_project_name.hex
: Contains contents of the program RAM.your_project_name.xml
: Another version of the default project parameters in XML format.PRINT_DSP_REGISTER
function name to SIGMA_PRINT_REGISTER
for consistencySIGMA_READ_REGISTER
function name to SIGMA_READ_REGISTER_BYTES
for consistencySIGMA_PRINT_REGISTER
calls SIGMA_READ_REGISTER_BYTES
instead of double-implementing the commsSIGMASTUDIOTYPE_8_24_CONVERT
is now an alias for SIGMASTUDIOTYPE_FIXPOINT_CONVERT
SIGMASTUDIOTYPE_FIXPOINT_CONVERT
switches to the proper implementation based on DSP type (8.24 or 5.23 number formats)SIGMASTUDIOTYPE_INTEGER_CONVERT
is now a passthrough macrogetMemoryDepth
is now under a compiler switch to remove from memory unless I2C is enabledSIGMA_WRITE_REGISTER_BLOCK
which omits the DSP addressSIGMASTUDIOTYPE_REGISTER_CONVERT
SIGMA_WRITE_REGISTER_FLOAT
SIGMA_WRITE_REGISTER_INTEGER
SIGMA_READ_REGISTER_FLOAT
SIGMA_READ_REGISTER_INTEGER
Initial Release