EmbDev.net

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


Author: Peter Elsesser (_peter_)
Posted on:

Rate this post
0 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

Author: Peter Elsesser (_peter_)
Posted on:

Rate this post
0 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

Author: Peter Elsesser (_peter_)
Posted on:

Rate this post
0 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...

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.