Analog.com Analog Dialogue Wiki 简体中文
EngineerZone
EngineerZone
  • Log in
  • Site
  • Search
  • Log in
  • Home
  • Blogs ⌵
    • EngineerZone Spotlight
    • The Engineering Mind
    • Analog Garage
  • Browse ⌵
    • All Groups
    • All Members
  • Support ⌵
    • 3D ToF Depth Sensing
    • Amplifiers
    • Analog Microcontrollers
    • Audio
    • Clock and Timing
    • Data Converters
    • Design Tools and Calculators
    • Direct Digital Synthesis (DDS)
    • Embedded Vision Sensing
    • Energy Monitoring and Metering
    • FPGA Reference Designs
    • Industrial Ethernet
    • Interface and Isolation
    • Low Power RF Transceivers
    • MeasureWare
    • MEMS Inertial Sensors
    • Motor Control Hardware Platforms
    • Optical Sensing
    • Power By Linear
    • Processors and DSP
    • Reference Circuits
    • RF and Microwave
    • Switches/Multiplexers
    • Temperature Sensors
    • Video
    • Wireless Sensor Networks Reference Library
  • My EZ
  • More
  • Cancel
SigmaDSP Processors and SigmaStudio Development Tool
  • Processors and DSP
  • More
SigmaDSP Processors and SigmaStudio Development Tool
Documents Booting a SigmaDSP from a microcontroller with no C compiler
  • Q&A
  • Discussions
  • Documents
  • File Uploads
  • Video/Images
  • Tags
  • Reports
  • More
  • Cancel
  • New
SigmaDSP Processors and SigmaStudio Development Tool requires membership for participation - click to join
  • Documents
  • 96 kHz operation for ADAU1452 serial ports
  • ADAU1701 Input and Output Signal Routing
  • ADAU1701: ADC resistor values for higher sample rates
  • Booting a SigmaDSP from a microcontroller with no C compiler
  • Calculating Filter Coefficients to Store in a Microcontroller
  • Can ADI provide or support the USB interface firmware code for my self-assembled PCB or end product?
  • Can ADI provide or support the USB interface firmware code for my self-assembled PCB or end product? - 2
  • Can I program multiple SigmaDSPs in parallel using one USBi?
  • Can I use SigmaDSP to decode MP3/WAV/AAC?
  • Can SigmaDSP do frequency-domain processing like FFT or pitch shift?
  • Can the ADAU1772 be used with a TDM output stream that has an odd number of channels?
  • Compressor Table Format - Changing compressors at run-time
  • Creating a delay after startup
  • Creating a simple balance crossfade control
  • E2PROM Selfboot problem
  • Empty Cells
  • EVAL-ADAU144XEBZ Evaluation Board Schematics
  • EVAL-ADAU1781Z GPIO Mapping in SigmaStudio
  • EVAL-ADAU1781Z GPIO Mapping in SigmaStudio - 2
  • Example Project: Using the Stopwatch to Count Successive Samples over a Threshold
  • Excluding Cells from the Exported System Files
  • FAQ: After downloading self-boot code to my target EEPROM, my USBi isn't recognized anymore by my computer. What's wrong and how do I fix it?
  • FAQ: Can I write C or assembly code for SigmaDSP in SigmaStudio?
  • FAQ: Can we bundle SigmaStudio with our product design?
  • FAQ: Developing custom algorithms and/or using 3rd party algorithms
  • FAQ: How can I change parameters on-the-fly in an application without SigmaStudio?
  • FAQ: How can I estimate MIPS/Memory resource on SigmaDSP?
  • FAQ: How do I change the sample rate of my SigmaStudio system?
  • FAQ: What operating systems are supported to run SigmaStudio?
  • FAQ: What types of capacitors are good to use in the analog audio signal path?
  • FAQ: Where can I send my questions I don't want to post in a public forum?
  • FAQ: Why can't I control any of the knobs or sliders in my SigmaStudio project?
  • FAQ:  Can I have multiple versions of SigmaStudio installed simultaneously?
  • FAQ:  Where can I download SigmaStudio?
  • FAQ:  Where can I find a description of the changes made in the latest version of SigmaStudio?
  • FAQ:  Which SigmaDSP ICs support selfbooting from an EEPROM?
  • FAQ:  Why isn't a software/documentation CD included with my evaluation board?
  • How are the audio inputs routed in SigmaStudio's Input cell?
  • How do I create the microcontroller code to interface to my SigmaDSP?
  • How do I execute a software safeload write?
  • How do I implement external volume control using GPIOs or Aux ADCs?
  • How do I report a SigmaStudio bug?
  • How do I start a timer after power-on, or when the input signal goes away?
  • How do I use a GPIO button to select different audio processing paths?
  • How many instructions can be executed per sample in SigmaDSP?
  • How to avoid distortion or clipping on the ADC inputs for the ADAU144x evaluation board
  • How to avoid distortion or clipping on the ADC inputs for the ADAU144x evaluation board - 2
  • How to calculate index table values in 28.0 format
  • How to create a crossover with more than 3 bands
  • How to self-boot the EVAL-ADAU1401AEBZ (evaluation board for ADAU1701, ADAU1702, and ADAU1401A)
  • How to self-boot the EVAL-ADAU1701MINIZ (evaluation board for ADAU1701, ADAU1702, and ADAU1401A)
  • Implementing Safeload Writes on the ADAU1701
  • Memory requirements for booting a SigmaDSP with a microcontroller
  • Monitoring average and instantaneous signal levels
  • My 2IN4OUT Proto with SPDIF based on ADAU1701
  • My IIR filter is outputting a value, even when the input goes to zero. Is this a bug?
  • New Sigma300 Family Products:  ADAU1451 & ADAU1450
  • New SigmaStudio 3.3 Beta Version Available
  • New SigmaStudio Download Site
  • Peak Full Range Compressor
  • Playing audio samples in SigmaDSP
  • Preserving "Ear-candy" in a mono mix
  • Problems with Push Button Volume w/Mute module
  • Setting the PLL mode for the ADAU1701 at different sample rates
  • Sigma 300 (ADAU145x) Exponential Slewing
  • SigmaDSP PCB Layout Best Practices
  • SigmaDSP Products and Evaluation Boards - ROHS and REACH Compliance
  • SigmaStudio 3.4 Released
  • SigmaStudio consulting services...
  • Slow rate random number generator
  • Stimulus-Probe Capability and Limitations
  • Testing USB communications between the PC and SigmaDSP
  • The ADAU1372 is not on the list of compatible processors or under Processors/DSPs on Sigmastudio 3.11.1 or 3.11. Can you please tell me how I can use the EVAL board with ADAU1372?
  • Third Party Algorithm Plugins in SigmaStudio
  • Thoughts on using index selectable filters...
  • True peak-to-peak detection in SigmaStudio
  • Truncating bits using bitwise logic
  • Updated self-boot EEPROM image generation / download
  • Updating SigmaDSP Parameter with a Microcontroller
  • Using compressors to avoid output clipping
  • Using hardware data capture (trap) registers with the DSP Readback cell (AD1940, ADAU1701)
  • Using stopwatch with feedback loop to create periodic test signal
  • Using the ADAU145x's Slew Ext Volume Block
  • Using the DSP Control mode of the ADAU1761 PGA / ALC
  • Using two SigmaDSP evaluation boards simultaneously with one USBi board
  • Welcome to the SIGMADSP Processors and SIGMASTUDIO Development tool community
  • What are the mute ramp times in the AD193x codecs?
  • What are the number formats for SigmaDSP?
  • What is the step size for audio delay in a SigmaDSP?
  • When should I use single precision or double precision filters?
  • Where can I buy a SigmaDSP Evaluation Board or USBi (EVAL-ADUSB2EBZ)?
  • Which SPI Mode is used by SigmaDSP Devices?
  • Workaround: Creating constant-dB envelope decay using an existing linear decay algorithm
  • [bug report] False frequency response displayed in a parametric equalizer window for an IIR coefficient filter
  • [Tutorial] Using Hierarchy Boards to create re-usable code

Booting a SigmaDSP from a microcontroller with no C compiler

My microcontroller does not have a C compiler. How do I use a microcontroller to boot my SigmaDSP in assembly?

_________________________________________________________________

In SigmaStudio, a number of things are downloaded to the target hardware when the user clicks the "Link-Compile-Download" button:

  • Program RAM
  • Parameter RAM
  • Non-Modulo Data RAM
  • Hardware Control Registers

That might not sound like much, but for a simple ADAU1781 program like this...

(screenshot of basic ADAU1781 project)

...the data that is downloaded looks like THIS:

(screenshot of the Capture Window in SigmaStudio for the example project download)

These data downloads have to occur in the exact same sequence on your  microcontroller in order to get the SigmaDSP into the same operating  mode as it is when the code is downloaded via SigmaStudio. That's quite a bit of data.

Unfortunately, the data files generated in the project folder by default (hex_program_data.dat, for example) simply contain the program RAM and parameter RAM contents of the project. That will not suffice. You need to get all of the information shown above in order to make your hardware work properly. In other words, you need to emulate the exact write sequence shown in the capture window above.

There is a way to manually copy this information out to raw address + data files by right-clicking one line at a time, as shown here:

(manually exporting raw data)

However, as you can imagine, that's very time-consuming...

Luckily, there's an easier solution!

First, make sure your project is compiled by pressing the Link-Compile-Download button:

(Link-Compile-Download)

Now, click the button to its immediate right, labeled Export System Files:

(Export System Files)

This generates a huge amount of data in the form of C-compatible include files and raw data files, as you have seen. In the case of assembly programming, the C header files are pretty useless. However, the important files for the initialization download are these two files:

(NumBytes and TxBuffer files)

These two files contain all of the data you need to boot your chip. The file TxBuffer contains the I2C address and write data for every address in the download sequence shown above in the Capture Window.

For example, the first two lines of this file are as follows:

0x40, 0xEB,             /* (0) IC 1.Start Pulse */
0x0A,

If you refer to the Capture Window screenshot above, you'll see that the first register write is to address 0x40EB, and the data is 0x0A.

The next two lines in TxBuffer are as follows:

0x40, 0xF6,             /* (1) IC 1.Sound Engine Run */
0x00,

If you refer to the Capture Window screenshot above, you'll see that the second register write is to address 0x40F6, and the data is 0x00.

And so on....

The file NumBytes accompanies TxBuffer in that it shows how many bytes are included in each transaction. For the first two examples I showed above, there are 2 address bytes and 1 data byte. So, as one might expect, the first two lines of the NumBytes file are:

3,
3,

When you get down to the program and parameter RAM downloads, you'll see much larger numbers like:

702,
226,

The main idea is that you can parse these two files and easily create an I2C write function that will download all of the data in order. No C compiler required!

The NumBytes and TxBuffer files for my example project are attached for your reference.

This FAQ was generated from the following discussion: Loading the DSP via assembly language

Attachments:
0336.TxBuffer_IC_1.dat.zip
6644.NumBytes_IC_1.dat.zip
  • i2c
  • spi
  • microcontroller
  • assembly
  • sigmastudio
  • sigmadsp
  • Share
  • History
  • More
  • Cancel
Comments
Anonymous
Parents
  • HowardE
    HowardE over 4 years ago

    I'm trying to use this technique to program the 1761 on our system and I'm not having any success. I took the NumBytes.dat file and for each entry in that file I use that many bytes from the TxBuffer.dat file. The first two are used as the register. If the register is 0x0000, it's a delay and I wait for 100mS and ignore the following two bytes. What I have for code is this:

    for (i=0; i<(sizeof(White_Noise_Numbytes) >> 1); i++) {

       DSP_reg = White_Noise_TxBuffer[j++]; // high byte

       DSP_reg = (DSP_reg <<8) | White_Noise_TxBuffer[j++]; // low byte

       if (0 == DSP_reg) { // there is no address 0, so delay

          Delay(100);

          j = j + 2; // skip over the two data bytes

       } else if (3 == White_Noise_Numbytes[i]) { // Just a single byte

          write_dsp(DSP_reg, White_Noise_TxBuffer[j++]);

       } else { // multiple bytes

          DSP_count = White_Noise_Numbytes[i] - 2;

          write_dsp_block(DSP_reg, White_Noise_TxBuffer+j, DSP_count);

          j = j + DSP_count;

       }

    }

    write_dsp() is an I2C routine specific to our SiLabs chip that uses the first arg as the register and the second as a single byte, It's doing the I2C write directly with the SiLabs registers and I can see on a logic analyzer that it's working correctly. Similarly, write_dsp_block() uses the address as well as a pointer to a block of data and uses a third count argument. The analyzer confirms that those bytes look correct and get ack'd by the DSP.

    The two data structures are the numbytes.dat and the txbuffer.dat files with array inits wrapped around them like this:

    unsigned short White_Noise_Numbytes[] = {

            3,

            3,

            3,

            8,

    (more of the same)

    }

    char White_Noise_TxBuffer[] = {

            0x40, 0xEB,             /* (0) IC 1.Sample Rate Setting */

            0x7F,

            0x40, 0xF6,             /* (1) IC 1.DSP Run Register */

            0x00,

            0x40, 0x00,             /* (2) IC 1.Clock Control Register */

            0x0F,

            0x40, 0x02,             /* (3) IC 1.PLL Control Register */

            0x00, 0x01, 0x00, 0x00, 0x20,

            0x03,

            0x00, 0x00,             /* (4) IC 1.Delay */

            0x00, 0x64,

    (more of the same)

    }

    Is it as simple as using the lengths in numbytes to then pick an entry out of txbuffer, spew each of them out via I2C and watch it work? Is there another trick and if anyone has ever done it on any processor, is there code they can share? I'll swap my SiLabs Gecko code for it, or pay for your next six-pack.

    Thanks!

    Howard

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Comment
  • HowardE
    HowardE over 4 years ago

    I'm trying to use this technique to program the 1761 on our system and I'm not having any success. I took the NumBytes.dat file and for each entry in that file I use that many bytes from the TxBuffer.dat file. The first two are used as the register. If the register is 0x0000, it's a delay and I wait for 100mS and ignore the following two bytes. What I have for code is this:

    for (i=0; i<(sizeof(White_Noise_Numbytes) >> 1); i++) {

       DSP_reg = White_Noise_TxBuffer[j++]; // high byte

       DSP_reg = (DSP_reg <<8) | White_Noise_TxBuffer[j++]; // low byte

       if (0 == DSP_reg) { // there is no address 0, so delay

          Delay(100);

          j = j + 2; // skip over the two data bytes

       } else if (3 == White_Noise_Numbytes[i]) { // Just a single byte

          write_dsp(DSP_reg, White_Noise_TxBuffer[j++]);

       } else { // multiple bytes

          DSP_count = White_Noise_Numbytes[i] - 2;

          write_dsp_block(DSP_reg, White_Noise_TxBuffer+j, DSP_count);

          j = j + DSP_count;

       }

    }

    write_dsp() is an I2C routine specific to our SiLabs chip that uses the first arg as the register and the second as a single byte, It's doing the I2C write directly with the SiLabs registers and I can see on a logic analyzer that it's working correctly. Similarly, write_dsp_block() uses the address as well as a pointer to a block of data and uses a third count argument. The analyzer confirms that those bytes look correct and get ack'd by the DSP.

    The two data structures are the numbytes.dat and the txbuffer.dat files with array inits wrapped around them like this:

    unsigned short White_Noise_Numbytes[] = {

            3,

            3,

            3,

            8,

    (more of the same)

    }

    char White_Noise_TxBuffer[] = {

            0x40, 0xEB,             /* (0) IC 1.Sample Rate Setting */

            0x7F,

            0x40, 0xF6,             /* (1) IC 1.DSP Run Register */

            0x00,

            0x40, 0x00,             /* (2) IC 1.Clock Control Register */

            0x0F,

            0x40, 0x02,             /* (3) IC 1.PLL Control Register */

            0x00, 0x01, 0x00, 0x00, 0x20,

            0x03,

            0x00, 0x00,             /* (4) IC 1.Delay */

            0x00, 0x64,

    (more of the same)

    }

    Is it as simple as using the lengths in numbytes to then pick an entry out of txbuffer, spew each of them out via I2C and watch it work? Is there another trick and if anyone has ever done it on any processor, is there code they can share? I'll swap my SiLabs Gecko code for it, or pay for your next six-pack.

    Thanks!

    Howard

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Children
No Data
Related
 
Social
Quick Links
  • About ADI
  • Partners
  • Analog Dialogue
  • Careers
  • Contact us
  • Investor Relations
  • News Room
  • Quality & Reliability
  • Sales & Distribution
  • Analog Garage
Global
Please Select a Region
India
India
Korea
Korea
Singapore
Singapore
Taiwan
Taiwan
Language
Please Select a Language
English
English
简体中文
简体中文
日本語
日本語
Руccкий
Руccкий
Languages
  • English
  • 简体中文
  • 日本語
  • Руccкий
Newsletters

Interested in the latest news and articles about ADI products, design tools, training and events? Choose from one of our 12 newsletters that match your product area of interest, delivered monthly or quarterly to your inbox.

Sign Up
Switch to mobile view
Analog Logo
© 1995 - 2019 Analog Devices, Inc. All Rights Reserved 沪ICP备09046653号
  • ©
  • 1995 - 2019 Analog Devices, Inc. All Rights Reserved
  • 沪ICP备09046653号
  • Sitemap
  • Privacy & Security
  • Privacy Settings
  • Terms of use
EngineerZone Uses cookies to ensure you get the best experience in our community. For more information on cookies, please read our Privacy & Security Statement.