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

How to generate MISO output signal from ADAU1701 for SPI control mode?

SigmaDSP & SigmaStudio kaeroul May 21, 2014 00:00 3 replies Original on forum ↗
Subscribe
kaeroul Question
May 21, 2014 00:00

good day everyone,

I am using ADAU1701 and arduino for SPI control mode. My question is, How can I generate output signal from MISO (COUT) pin of ADAU1701 using sigmastudio?

ADAU1701 is in SPI control mode after I pull clatch low three times by using arduino.

your guidance and help are much appreciated.

thanks and regards,

kal

Audio Signal Processors

adau1401

spi

sigmastudio

SigmaDSP Audio Processors

adau1701

Show More

twidget Reply
May 22, 2014 00:00

ADAU1701 is always a slave on the SPI bus. The ucontroller is the master and it is the device that initiates all data transfers. If you recall the SPI protocol, synchronous serial, full duplex, single master, 4-wire communication.

The 4 wires are:

SCLK: Serial Clock. This is an output from the master (ucontroller)

MOSI: Master Output, Slave Input. This is also an output from the master.

MISO: Master Input, Slave Output. This is an output from the slave (ADAU1701)

SS: Salve Select. Active low, output from the master to select the NOD on the SPI bus.

The master (ucontroller) is the conductor of this little SPI circus and it’s up to the ucontroller to decide if a read or write operation is requested. Refer to the data sheet (Page 26) for specific timing diagram for read/write.

A simplified answer:

Arduino pulls down the SS pin which says “Hey you, Listen to me!”

Arduino clocks in the first data byte which is a 7-bit chip address followed by a read/write bit. If you want to receive data from the ADAU1701, this bit is set to logic level 1. Arduino is saying “ADAU1701, I want to know something”

Arduino then clocks in the second and third data bytes. These are the sub-address. It’s the address of what you’re trying to talk to. Arduino says “What is the current volume level?”

SPI is full duplex, which means data goes out at the same time it comes in. That’s why SPI uses a MOSI and MISO. (Unlike I2C which is half duplex and only uses one bi-directional data line) Because the Arduino is the Master and because the Master generates the SCLK, Arduino needs to keep clocking in garbage so that the slave (ADAU1701) can send the requested data.

The ADAU1701 keeps the MISO line tri-stated until it’s ready to respond to a read request. (this allows multiple slaves to be present on the same SPI bus) On the start of Byte 3, ADAU1701 sends data bytes to the Arduino. The number of data bytes it sends depends on the sub-address of the read request. Arduino needs to keep clocking in garbage until all data bytes are returned. Arduino is saying “Blab la blabla… “ while at the same time ADAU1701 is saying “The volume is 11!”

When Arduino gets all the data, SS pin is pulled high. Arduino says “Cool man, thanks.. later”

So the only time your going to see data on MISO, is when Arduino request it.

kaeroul Reply
May 27, 2014 00:00

what an amazing explanation indeed. thanks twidget!!

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin