ΣSigmaStudio Ask AI Русский Log in

Master control port registers for address width and value?

SigmaDSP & SigmaStudio SoundConsulting Jul 10, 2025 00:00 3 replies Original on forum ↗
Thread Summary

Thread Summary

The user inquired about setting SPI address width and data byte count using DSP control registers on the ADAU1452. The final answer confirmed that these settings are configured in SigmaStudio during project compilation and cannot be changed at runtime via C code, as SigmaDSP does not support C compilation. The SPI address width is manually set in the EEPROM properties window, and the DSP treats all SPI devices as memory devices, requiring the correct address length for each peripheral. The user also explored the possibility of using write-only SPI to interface with Asahi Kasei 3-wire protocol devices, which was confirmed as feasible with proper configuration. The user later switched to the ADAU1463, which supports both SPI and I2C, for more flexibility in interfacing with the AK5574 ADC, AK4458 DAC, and LM63DIMAX temperature sensor.
AI Generated Content
Subscribe
SoundConsulting Question
Jul 10, 2025 00:00

Is it possible to set the SPI address width using the DSP control registers? I'm asking about the 2-byte (16-bit) versus 3-byte (24-bit) address variations.

On a similar note, is it possible to set the data byte count using the DSP control registers?

I read in the data sheet that the SigmaDSP automatically determines the SPI EEPROM address width during SELFBOOT, but I am asking about other peripherals that are also attached to the SPI master control port. Searching this Engineer Zone forum, I see comments that the SigmaDSP treats all SPI devices as memory devices, which implies that the same automatic address width determination might occur for all devices besides the SELFBOOT memory, but I want to confirm.

I get the impression that the SigmaStudio support assumes that the data to be written can be gathered into a file before compiling, but I am curious about manually coding Read and Write operations to SPI devices where the data is determined at run time.

I am currently designing the schematic for an ADAU1452 based DSP Board with AK5574 ADC and AK4458 DAC as well as a Texas Instruments LM63DIMAX to read the SigmaDSP temperature sensor.

The Asahi Kasei chips support 3-wire (write-only) or I2C serial communications, and although the ADAU1452 does not support 3-wire it seems like a write-only SPI transfer would look like the AK 3-wire protocol, provided that the address is 8-bit with one byte of data, or the address is 16-bit with no bytes of data. I will probably design for I2C comms with the AK chips, but I want to investigate the possibility of abusing SPI in write-only mode to meet the 3-wire protocol.

In addition, the LM63DIMAX uses the SMBus protocol, but it seems like that might be workable with a series of SPI transactions of the correct size and data. With other microcontrollers, I have managed to get successful SMBus comms without direct hardware support for SMBus, so it seems like this might be possible.

Audio Signal Processors

adau1452

Datasheet/Specs

AK5574

AK4458

LM63DIMAX

SigmaDSP Audio Processors

Show More

Harishgowtham Reply
Jul 14, 2025 00:00

Hello Soundconsulting,

SoundConsulting said:
Is it possible to set the SPI address width using the DSP control registers? I'm asking about the 2-byte (16-bit) versus 3-byte (24-bit) address variations.

On a similar note, is it possible to set the data byte count using the DSP control registers?

You can change them via slave control port by SPI/I2C, those parameters can be changed at runtime but there are things that you must take care. sometimes it may lead to undefined behavior. So, I'm not very sure what you are trying to do with that.

In the master control port blocks, you will load an XML file and send that to peripherals like programming a CODEC etc. The address byte given in the XML file (slave device's address length) should match with the address bytes shown in the sigma studio window, otherwise you will get a warning. so, you can choose the correct file and address bytes in sigma studio and then you compile the project, it will be fine.

If you want to use different XML file which uses different address length, then you will have to load the new XML file and the address bytes values in the sigma studio and the compile again, since you use the new file, you must compile the project. Now, let's say you loaded a file with sub-address bytes 2 and set sub-address byte 2 in sigma studio, now you compile and everything is fine. Now why are you trying to change the sub address byte parameter in runtime, when already compiled code (respective XML file is also compiled) is running in the DSP.

SoundConsulting said:
I read in the data sheet that the SigmaDSP automatically determines the SPI EEPROM address width during SELFBOOT, but I am asking about other peripherals that are also attached to the SPI master control port. Searching this Engineer Zone forum, I see comments that the SigmaDSP treats all SPI devices as memory devices, which implies that the same automatic address width determination might occur for all devices besides the SELFBOOT memory, but I want to confirm.

The SPI EEPROM size and address length are given as an input in the EEPROM properties window.

We will have to change the address length according to which chip we are writing to from the DSP, if I'm programming the AD193x codec then I will set the sub-address byte as 1 since AD193x has only 10 registers or something. If I'm programming another SigmaDSP from the primary sigmaDSP's master control port, then I will set the sub-address byte as 2. If I'm writing to a 1Mb EEPROM or flash memory, then I will set the sub address as 3. it will always work according to the slave device's memory.

I'm not sure if I have answered your question exactly, if not then please give me more info on what you are particularly looking for.

SoundConsulting said:
I get the impression that the SigmaStudio support assumes that the data to be written can be gathered into a file before compiling, but I am curious about manually coding Read and Write operations to SPI devices where the data is determined at run time.

The XML file that you load into the master control port will be loaded in the DM0 memory after compilation, then the data bytes are transferred to the slave devices via SPI/I2C. You can see that in the capture window, look at the size of DM0 before and after loading the XML file (after compilation). If you are using a triggering version of the master control port, then after you compiled the program, it's possible to change some content of the loaded file in the DM0 since it's a memory address, after you made the changes, you can trigger the block so the new data will be sent out of the master control port. But you will have to figure out where the XML file data is located in the DM0.

I haven't tried this method, but it seems like it will work.

Look at the below example, where I tried writing an XML to program the codec. You can see the exact register values are stored in the DM0, here the values are continuously stored, so the address will be auto incremented. so, you will have to look at the file like this and compare it and figure out what's happening.

I'm just giving you an idea of what can be done using sigma studio.

SoundConsulting said:
The Asahi Kasei chips support 3-wire (write-only) or I2C serial communications, and although the ADAU1452 does not support 3-wire it seems like a write-only SPI transfer would look like the AK 3-wire protocol, provided that the address is 8-bit with one byte of data, or the address is 16-bit with no bytes of data. I will probably design for I2C comms with the AK chips, but I want to investigate the possibility of abusing SPI in write-only mode to meet the 3-wire protocol.

Yes, you can connect CS, SCLK, MOSI from the DSP's master control port to the slave device, just to write only. This way you can get the AK chip programmed from the DSP. Make sure that the SPI modes and other things match between the devices.

Regards,

Harish

pastedimage1752487918296v1.png
pastedimage1752487918296v1.png
SoundConsulting Reply
Jul 17, 2025 00:00

I am new to SigmaDSP, so I may be making some assumptions that are not true. First of all, I assume that it is possible somewhere to write C code for compilation to run on the DSP that could access the SPI peripheral directly, using register bit fields to set address and data constraints. I understand the XML approach to SPI communications, but the non-code approach has its limits.

It looks like the EEPROM address width is preset by the configuration, according to what you describe. I'm not sure where I read that the ADAU145x automatically detects the size and adjusts the address width accordingly.

I'm still at the schematic and layout stages, so I have not yet started using SigmaStudio. I am currently just looking for more complete documentation of the peripheral registers, on the assumption that I can write custom C code, if needed. I have heard that third-party additions are available for SigmaStudio, so that strongly implies that *someone* can write C code to go beyond what SigmaStudio can handle by default.

Thank you for basically confirming that write-only SPI should map reasonably well to write-only 3-wire chips. I've changed my design from ADAU1452 to ADAU1463, so I now have both SPI and a separate I2C (on SCL2 and SDA2). I will probably try to design jumpers to allow AK chip access via SPI or I2C and see which works better.

Harishgowtham Reply
Jul 18, 2025 00:00

Hello soundConsulting,

Unfortunately, it's not possible to write a C code with SigmaDSP. There is no C compiler in SigmaDSP.

Sigma studio is the only tool which must be used to design your program flow with SigmaDSPs, because it only knows the SigmaDSP architecture, once the signal flow is designed and compiled, then you can export the system files and integrate it in your C code and make the SigmaDSP boot from a controller via SPI/I2C.

And when the SigmaDSP is boot up and running, you can access the parameters by SPI/I2C, you can change gain value runtime, read/write values, coefficients etc. from your controller. But program designing and compilation must be done in Sigma studio.

SoundConsulting said:
It looks like the EEPROM address width is preset by the configuration

when you write to EEPROM from DSP (during 'write latest compilation thru DSP' process), an EEPROM properties window will open and you will have to enter the EEPROM size, sub address bytes, page size, commands etc. Since each EEPROM memory address holds 1 byte data, it automatically increments and takes care of other things.

SoundConsulting said:
I have heard that third-party additions are available for SigmaStudio, so that strongly implies that *someone* can write C code to go beyond what SigmaStudio can handle by default.

Yes, there are third parties who write custom algorithms with SigmaDSP, but they will not use C, they will use architecture-based assembly language.

Since you are new to SigmaDSP, Dave's YouTube channel would be the great place to start with SigmaDSPs. I will attach the channel link below.

https://www.youtube.com/channel/UCHFzVRIj3YoH1Vdt866BZHw

Regards,

Harish