EmbDev.net

Forum: ARM programming with GCC/GNU tools ARM MP3/AAC Player left / right


von Peter E. (_peter_)


Rate this post
useful
not useful
Hi all,

I have build the ARM MP3/AAC Player based on the Olimex SAM7-H256 board.
The player randomly swaps left and right channel at startup or even if a
new track is started. I checked with an logic analyzer and an MP3 track
that only contains the left channel. The DAC is working ok, but the ARM
sometimes sends the data when LRCIN is low, that means right channel.
Has anyone faced the same problem or has it something to do with my
hardware ?

Any idea is welcome.

Peter

von Peter E. (_peter_)


Rate this post
useful
not useful
.......
dac_write_reg(AIC_REG_DIG_FORMAT, (1 << 6) | 2); // master, I2S left
aligned
// dac_write_reg(AIC_REG_DIG_ACT, 1 << 0); // activate digital interface

void dac_enable_dma()
{
  // enable DMA
  *AT91C_SSC_PTCR = AT91C_PDC_TXTEN;
  dac_write_reg(AIC_REG_DIG_ACT, 1 << 0); // activate digital interface
}

void dac_disable_dma()
{
  // disable DMA
  dac_write_reg(AIC_REG_DIG_ACT, 0); // deactivate digital interface
  *AT91C_SSC_PTCR = AT91C_PDC_TXTDIS;
}

have fun

Peter

von Peter E. (_peter_)


Rate this post
useful
not useful
faster is not always better, try this if TWI hangs:

  *AT91C_TWI_CWGR = (0 << 16) |    // CKDIV
                    (255 << 8) |    // CHDIV
                    (255 << 0);    // CLDIV

have even more fun...

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.