Audio Clock for MPC5200

There are a couple of ways to add an external audio clock to the MPC5200. The first thought is to run the MPC5200 I2S interfaces in slave mode and use an external audio clock to clock the interface externally. The idea would be to put the audio clock in the 'middle' of the connection between the MPC5200 and the TAS5504, running both devices in slave mode. The problem with this approach is that the MPC5200 can not produce bit and frame clocks while in slave mode. So, if an audio clock is added in this fashion, external logic also has to be added to create the bit and frame clocks. That adds complication/expense because that external logic would also have to be programmable to adapt to the different data rates we hope to support.

Jon pointed out that the MPC5200 does have a 'cell phone' mode where one programmable serial controller (PSC) can be used to clock another. The cell phone mode of the MPC5200 allows PSC1 to accept an external bit clock and pass it along to another PSC as its master clock. The second PSC is then free to use that master clock to produce bit and frame clocks, as well as transmit and receive data.

One hiccup in this plan is that when a PSC is driven in this fashion, it does not emit a master clock signal itself. So, the master clock has to be sent directly from the external clock chip to the TAS5504. A potential problem might be that as the master clock propagates through the MPC5200 to produce the bit and frame clocks of the slave PSC, it becomes delayed/skewed from the original master clock signal to the point that the TAS5504 is out of sync. However, the TAS5504 documenation says that this should not be a problem.

So, to prove this point and to gain some experience with this setup, we decided to do the following experiement.

We decided to use the MAX9485 from Maxim as the audio clock source. This chip can be controlled via I2C and supports audio data rates of 32KHz, 44.1KHz, 48KHz, 88.2KHz and 96KHz. Through internal manipulation of the clocks inside the MPC5200 and the TAS5504, we can also use this chip to support 176.4KHz and 192KHz.

The Clock Output of the MAX9485 was connected to the master clock input of the TAS5504 and the bit clock input of PSC1 on the MPC5200. The bit, frame and data output pins of PSC2 on the MPC5200 were then connected to the I2S channel 1 input of the TAS5504. The pictures below (sorry for the poor quality. Time for Tyler to get a new camera!) show how the chip was added to the first prototype. I decided to mount it on the bottom of the expansion card so that I could more easily wirewrap the connections to the patch field and the TAS5504 input header. You can just make out the power capacitor hanging out the bottom of the expansion card in the top view picture.

I have also attached two programs that I used to test the setup.

  1. tasclock
  2. This program is analogous to the previous program called tastone. It can be used to play square, triangle and sine waves of the supported frequencies on the TAS5504. The MAX9485 and the TAS5504 have to be setup manually (using something like i2cset) before tasclock can be used.

  3. tasplay
  4. This program is analogous to the previous program called taswave. It can be used to play small wave files on the TAS5504. This program sets up the MAX9485 and the TAS5504 so there is no need to manually configure them. However, you do still have to set the mater volume of the TAS5504 (I2C register 0xD9).