Is there a way to get the beagle system clock from the expansion?

I need this to connect an external device, but will require to use the
same clock as the beagle.

Can the system clock be routed to a GPIO?
or the MMC2 clock could be used?

There are several system clocks inside OMAP3530 system and there really isn’t a system clock per se. The MMC clock can go up to 48MHZ, but that is not the system clock, but one of the many clocks in the system. There are various clocks that feed various PLLs that drive various clock domains in the system. Any clock that would go out the expansion connector would be a devided down version, whether it be the MMC or one of the McBSP buses. You might want to look at the OMAP3530 Technical Reference Manual to see what clock you want to use and then see if it can be routed to a pin on the expansion connector.


The clock from the beagle will be used for an external clock on an audio codec. TWL4030 uses a 26Mhz clock by default.

For now I have configured the new codec to be Master and beagle as Slave but the clock from I2S is not syncronized and some noise is generated. The correct configuration should be the beagle as Master and the codec as Slave.

On Beagle board both the TWL4030 and beagle are configured as Master, which I believe is because they share the same clock at same frecuency and that guarantees the syncronization. This is just a guess.

My next approach would be to get the same clock from TWL4030 and use it also to provide the external clock for the external codec. Any posible way of doing this?

A clock for an external audio CODEC is no issue. That can easily be done. The 26MHZ on the TWL4030 is used for internal purposes and is used by the internal CODEC and I believe is always in master mode if I remember correctly. You might want to check the TWL4030 TRM for more information to see if it can be done differently.

If you want an external CODEC, use the one on the expansion connector and configure as you need. The TWL4030 is not involved in that aspect of the operation. Just set up a seperate interface and set the clocking as needed. So, there is no need to ge tthe clock form the TWL4030 for an external codec. The clock will go out or in the McBSP port on the expansion connector.


That is my main problem. The codec is correctly connected via I2S(McBSP3 configured and pinmuxed) and I2C(I2C2) but the codec requires an extra line as clock, because it can’t get the clock from the I2S bus.

From where do I get the line for the external clock? the 26Mhz preferably.
Thanks for all your help.

I see. There is no way to get the 26MHZ out to the expansion bus so I would just add an external oscillator to the CODEC itself.


Hi Gerald.

I work with Ernesto in this effort.

The audio codec already has an external oscillator, but according to
Analog, it's still required, which is kind of odd.

Since the external audio codec has an external oscillator, we still
might need to connect the clocks for sync purposes, shouldn't we?

Or would it just suffix to write a small synchronization routine?


Alex B.

Why should it matter to synchronize the Beagle 26MHz clock to the external
codec clock? And what would you exactly do? Run the codec of the 26MHz BB
clock instead of the external oscillator? Is you external oscillator as well

As such the 26Mhz clock hasn't anything to do with the McBSP signals and for
a stereo 16bit 48KHz signal the 26MHz isn't an integer multiple of the McBSP
clock (2*16*48000 = 1.535kHz = 26MHz/16,92708333~), so the clocks will never
in synch anyway......

Without knowing your exact schematics I think Analog is trick you :slight_smile:

Best regards

I2S is CLK, FSYNC, DX, and DR. That is all you need for the interface. Unless, the CODEC is not really I2S. Which CODEC are you trying to use?


Hold on. =)

Ernesto is recording what we hear instead of sound.

Maybe this way, we can start over the discussion (with a sample of how
the output is coming out).

Can we send a wav file to the list or shall be send it directly to
Gerald and Soren?


Alex B.

Have you tried using the validation SW to record the audio and play it back? This is what we use in the production test. What is the source of the audio?


We are actually using those same tools. =)

We are again rechecking all settings. We saw something in the alsa
list today that could be related (it could be we are not syncing
correctly the writing of bytes with the right phase of the I2S clock
signaling where every word ends or something similar).


Alex B.

You can solder a wire onto the Beagle and route it to your board for the 26MHZ. But, it will be 1.8V, so if that is not compatible, it will need to be level shifted. I have done many OMAP EVMs and the 26MHZ from OMAP was not an issue, although OMAP can send out a clock, but it is not on one of the pins on the expansion connector.


I much more believe in this failure - Not synching data and synch signal
correctly can generate all kind of strange repeating sounds - I think I have
tried most of them over the years :slight_smile:

In order to check this, send out a sine wave and look at the output of the
codec with an oscilloscope - It's by far the easiest. Then you can see what
is actually going on with the output compared to the data you generate in
your C-program...

Best regards

PS: AFAIR: TWL4030 needs the input data in a signed (1-complement). If your
codec only accepts positive numbers you will get a strange "metallic sound"
due to the discontinuities at the 0 crossings... Might be this is what you

Here is the codec datasheet:

It seems the codec uses 2-complement for the data, so this may be the issue.

Hi Soren.

Attached you'll find 2 files.

One contains a tone with a squared shape. The second one contains how
it's processed currently by our codec (with the strange noises and

We are leaning towards your theory about being a problem with syncing
the writing with the different phases of the I2S.

Your opinion on this will be really helpful.

Best regards,

Alex B.

square_tone.wav (1.08 MB)

square_tone_codec.wav (1.27 MB)