DSPRelated.com
Forums

DSK5416 PCM Player

Started by clayd August 14, 2002
Hi,

I'd like to load a PCM file to the on-board memory and then play it
through the PCM3002 codec on the DSK5416.

I'm stumped with trying to configure the McBSP for the frequency and
bit length of the sample I've loaded.

Does anyone have any pointers to how to configure the McBSP? I've
tried to really dig into the documentation but haven't had any luck.

Final Question? Is this a reasonable project? To basically load a
raw PCM file into memory and then write it out to the codec 16 bits
at a time using the properly configured McBSP. It seems like it to
me, but I'm missing something, I'd appreciate it if someone let
me know.

Thanks for the help,
Clay



Hi Clay

I've configured the MCBSP for PCM playback, but for the C5402.
I think that configuration should be the same. It's like this:

void MCBSP_Init()
{

//---SERIAL PORT CONTROL REGISTER 1
// DLB=0, RJUST=0, CLKSTP=0, DXENA=0,ABIS=0
//RINTM=0, /RRST=0
SPSA = SPCR1;
SPSAR=0x0;

//---SERIAL PORT CONTROL REGISTER 2
//FREE=1, SOFT=0, /FRST=0, /GRST=0, XINTM=0, /XRST=0
SPSA = SPCR2;
SPSAR= 0x0;

//---PIN CONTROL REGISTER
//XIOEN=0. RIOEN=0, FSXM=1, FSRM=1, CLKXM=1, CLKRM=1, FSXP=0
//FSRP=0, CLKXP=1, CLKRP=0
SPSA = PCR;
SPSAR= 0x0F02; // TRANSMIT CLOCK POLARITY =1

//---TRANSMIT CONTROL REGISTER 1
//XFRLEN1=1 Frame word length=2;
//XWDLEN10 Word length bits
SPSA = XCR1;
SPSAR= 0x0140;

//---TRANSMIT CONTROL REGISTER 2
//XPHASE=0, XFRLEN2=0, XWDLEN20,
//XCOMPAND, XFIG=0, XDATDLY
SPSA = XCR2;
SPSAR= 0x0040;

//---SAMPLE RATE GENERATOR REGISTER 1
//FWID=0xF Frame width
//CLKGDV=D Clockns*140ns
SPSA = SRGR1;
SPSAR = 0x0F46;//0x0F46;

//---SAMPLE RATE GENERATOR REGISTER 2
//GSYNC=0, CLKSP=0, CLKSM=1, FSGM=1
//FPER, frame period2 clocks
SPSA = SRGR2;
SPSAR = 0x301F;

SPSA = SPCR2;
tmp=SPSAR;
tmp|=0x0040;
SPSAR=tmp; //unreset GRST

SPSA = SPCR2;
tmp=SPSAR;
tmp|=0x0080;
SPSAR=tmp; //unreset FRST

SPSA = SPCR2;
tmp=SPSAR;
tmp|=0x0001;
SPSAR=tmp; //unreset Transmitter
} This configures the McBSP to work with the DMA. You can change that if you
want. Also the CLKSM=1 for my AUDIO DAC, you might want to change this. (PCM
format: 44.100Hz, 16 bits, 2 channels)

What you are trying to do is reasonable. My DAC works fine with the MCBSP
and the DMA (i advise you to use the DMA it's very easy). If you are playing
small PCM files (mono, 8 bits etc), memory should be enough.

Hope i've helped
Regards

George Chatzigeorgiou

----- Original Message -----
From: "clayd" <>
To: <>
Sent: Thursday, August 15, 2002 12:30 AM
Subject: [c54x] DSK5416 PCM Player Hi,

I'd like to load a PCM file to the on-board memory and then play it
through the PCM3002 codec on the DSK5416.

I'm stumped with trying to configure the McBSP for the frequency and
bit length of the sample I've loaded.

Does anyone have any pointers to how to configure the McBSP? I've
tried to really dig into the documentation but haven't had any luck.

Final Question? Is this a reasonable project? To basically load a
raw PCM file into memory and then write it out to the codec 16 bits
at a time using the properly configured McBSP. It seems like it to
me, but I'm missing something, I'd appreciate it if someone let
me know.

Thanks for the help,
Clay
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to

To Post: Send an email to

To Leave: Send an email to

Archives: http://www.yahoogroups.com/group/c54x

Other Groups: http://www.dsprelated.com ">http://docs.yahoo.com/info/terms/