Booting a SigmaDSP from a microcontroller with no C compiler

Document created by BrettG on Oct 14, 2011Last modified by BrettG on Oct 14, 2011
Version 2Show Document
  • View in full screen mode

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...

ScreenHunter_02 Oct. 14 14.47.jpg

(screenshot of basic ADAU1781 project)


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

ScreenHunter_04 Oct. 14 14.48.jpg

(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:

ScreenHunter_05 Oct. 14 14.48.jpg

(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:

ScreenHunter_03 Oct. 14 14.47.jpg



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

ScreenHunter_06 Oct. 14 14.48.jpg

(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:

ScreenHunter_09 Oct. 14 14.59.jpg

(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 */

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 */

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:



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



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

6 people found this helpful