Can I write to the SigmaDSP RAM in byte-by-byte fasion? (i.e. One byte per write?)
My microcontroller's I2C or SPI write function can only write a single byte at a time. How can I write to the SigmaDSP's memory?
i2c
memory
spi
control_port
ram
Depending on what chip you are using and what kind of data you are writing, you will need a variable write length when addressing the SigmaDSP's memory and registers.
There are typically four types of addresses you need to write in the SigmaDSP, and they all have different lengths.
Registers are typically one or two bytes per address. For example, the ADAU1781 has one byte of data per register, so your I2C/SPI function would need to write the 2 address bytes and then one data byte. Conversely, the ADAU1442 has two bytes of data per register, so your I2C/SPI function would need to write the 2 address bytes and then two data bytes.
Parameter RAM is typically four bytes per address. So, you need to write the 2 address bytes and then 4 data bytes, for a total of 6 bytes.
Non-modulo data RAM is also typically four bytes per address. So, you need to write the 2 address bytes and then 4 data bytes, for a total of 6 bytes.
Program instructions are typically five data bytes per address (sometimes more or less). In the case of 5 bytes per address, you would need to write the 2 address bytes followed by 5 data bytes.
So, if you try to write only one byte to the parameter RAM or program RAM, it won't work, because those addresses store multiple bytes each!
You'll note that SigmaStudio (and the output files it generates) does not write parameter RAM or program RAM one address at a time. It instead writes a "block write" or burst write".
Burst mode can be used to fill contiguous register or RAM locations. A burst mode write begins by writing the address and data of the first RAM or register location to be written. Rather than ending the control port transaction (by issuing a stop command in I2C mode or by bringing the CLATCH signal high in SPI mode after the data-word), as would be done in a single-address write, the next data-word can be written immediately without specifying its address. The control port auto-increments the address of each write even across the boundaries of the different RAMs and registers.
This question has been closed by the EZ team and is assumed answered.
Please log in to reply.