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

Configure codec through Master Control Port

Processors & DSP op-electronics Jun 16, 2026 00:00 2 replies Original on forum ↗
Subscribe
op-electronics Question
Jun 16, 2026 00:00

Hello,

i need to configure my codec, AK4619 through ADAU1466 master control port via SPI but i don't know how to setup the XML file. There's an example in the Toolbox but it only covers I2C.

Any chance to see a SPI example?

The AK4619 needs the following message format:

1 byte command + 2 bytes address + N bytes data

The write command is 0xC3 but before sending any SPI data i have to send a dummy byte sequence to switch AK4619 from I2C to SPI, but the command byte is actually different.

Here's the bytes sequence:

command + address + byte
0xDE 0xADDA 0x7A

So i have to send from master control a byte sequence with command byte 0xDE and then switch the command byte to 0xC3 for writing.

So my question is, how can i do this?

From master control port cell i see the command byte is fixed, is there a way to change it dynamically maybe from the XML file?

Another option could be to use the master control port Startup cell with the dummy write command to switch the codec in SPI mode and then use the runtime cell (triggered by a timer maybe) for the real configuration.

Hope it makes sense!

Thank you everybody

Omar

software

spi

codec

master control port

processors and dsp

Processors and Microcontrollers

adau1466

Show More

DaveThib Reply
Jun 16, 2026 00:00

Hello Omar,

I do not think I am fully understanding your situation.

So do you have to start by sending some data via I2C then switch to SPI? That would be tough and I do not think it is possible.

You might be able to treat it as two different parts and send out the first commands then send the rest.

Here is the help file for the control port

Master Control Port Boot time I/O (ADAU145x) [Analog Devices Wiki]

Dave T

op-electronics Reply
Jun 17, 2026 00:00

Hello Dave!

my fault for the bad explanation. I don't need to send data via I2C and then SPI. What i need to do over SPI is:

1) do a write operation with a certain command byte (0xDE) - this is for switching the codec interface from I2C to SPI

2) do another write operation with a different command byte (0xC3) - for actual codec configuration

But...the command byte in the master control port cell has to be set before compiling:

so, i was asking if it can be set dynamically via the XML file so that it would overwrite the Write Instruction field.

The other option is to use 2 master control port cells, each one with its own write instruction:

What do you think about it?

Hope it's clear now!

Thank you

Omar

p.s

i've checked the link but it only covers I2C and not SPI.

pastedimage1781675263265v2.png
pastedimage1781675263265v2.png
pastedimage1781676806317v3.png
pastedimage1781676806317v3.png