DSPRelated.com
Forums

Connect codec PCM4201EVM board to DSK5416 Board

Started by seba...@seareka.com June 19, 2008
Hi,

I would like to connect codec PCM4201EVM board to DSK5416 Board. Thus, I connected PINS BCK, FSYNC, SDOUT and GND from PCM4201EVM to PINS DC_BCLKR0, DC_FSR0,DC_BDR0 respectively on DSK5416 board using external peripheral (P2).
The PCM4201EVM is working in master mode and generate BCK and FSYNC.
Using this plugging i'm opening McBsp0 and put clock mode and Frame sync to external.
Looking at adress 0x0020 or 0x0021 (depending on number of bit) the value doesn't change.

Does anybody know the reason ?

Thanks in advance,

Sebastien
Sebastien-

> I would like to connect codec PCM4201EVM board to DSK5416 Board. Thus,
> I connected PINS BCK, FSYNC, SDOUT and GND from PCM4201EVM to PINS
> DC_BCLKR0, DC_FSR0,DC_BDR0 respectively on DSK5416 board using external
> peripheral (P2).
> The PCM4201EVM is working in master mode and generate BCK and FSYNC.
> Using this plugging i'm opening McBsp0 and put clock mode and Frame
> sync to external. Looking at adress 0x0020 or 0x0021 (depending on
> number of bit) the value doesn't change.
>
> Does anybody know the reason ?

Trying to think back to C5416 days... the DSK 5416 onboard audio chip is connected to
McBSP2, and McBSP0 is routed directly to the daughterboard connector, so what you're
doing ought to work. Have you verified on the scope that clock and framesync are
reaching the DSP? You can check this easily on U23.

Also, did you check RRDY and RERR bits in McBSP0 status registers? (Those spellings
may not be correct, but look for something close.) If the McBSP receives anything at
all those bits should "move".

-Jeff
Hi,

Thanks for your respond,

I have checked on a scope clock and framesync on U23 and Inputs, Outputs are ok.
I also checked the RRDY bit on SPCR register and it gives me 0x4000 value.
RRDY is the first bit, so it gives me 0.

I do not understand why is stay to 0 while signals are ok on chip U23 ???

thanks for your help,

sebastien
Sebastien-

> Thanks for your respond,
>
> I have checked on a scope clock and framesync on U23 and Inputs, Outputs are ok.
> I also checked the RRDY bit on SPCR register and it gives me 0x4000 value.
> RRDY is the first bit, so it gives me 0.
>
> I do not understand why is stay to 0 while signals are ok on chip U23 ???

On C54xx devices, SPCR1[0] access requires a sub-address setting; i.e. SPCR1
register, port 0 (McBSP0). Therefore you have to set SPSA0 first (located at address
0x0038). Are you doing that before trying to read RRDY?

-Jeff
Sebastien-

> "On C54xx devices, SPCR1[0] access requires a sub-address
> setting; i.e. SPCR1 register, port 0 (McBSP0). Therefore you have
> to set SPSA0 first (located at address 0x0038). Are you doing that
> before trying to read RRDY?"
>
> I open the McBsp0 using DSP/Bios Configuration. So I'm wondering,
> Is the SPSA0 set automatically when using DSP/Bios Configuration ?

How do use DSP/BIOS config to "open" a McBSP? If you search the C5000 DSP/BIOS API
Reference Guide:

http://focus.ti.com/lit/ug/spru404g/spru404g.pdf

there are no references to McBSP APIs. So you must be doing something else -- what?
Using CSL?

I assume that C54x CSL functions would handle SPSAn registers correctly, but it's not
clear to me what you're actually doing. Suggest to post a small piece of your C code
that opens/initializes McBSP0.

-Jeff
>How do use DSP/BIOS config to "open" a McBSP? If you search the C5000 >DSP/BIOS API
>Reference Guide:
> http://focus.ti.com/lit/ug/spru404g/spru404g.pdf
>there are no references to McBSP APIs. So you must be doing something else >-- what?
>Using CSL?
>I assume that C54x CSL functions would handle SPSAn registers correctly, but >it's not
>clear to me what you're actually doing. Suggest to post a small piece of >your C code
>that opens/initializes McBSP0.
>-Jeff
I'm using Code Composer Studio 3.1. I'm using the interface tool DSP/Bios configuration. File ->New -> DSP/Bios configuration. (http://www.mne.psu.edu/brennan/ME597D%20Mechatronics/Lesson_009_RealTimeSystemConcepts/DSP%20Bios%20Users%20Guide%20_%20spru423b.pdf)
p 25 you can see the interface that i have. Thus, using this interface, you can open and configure McBsp, Dma and others pretty easily.
When doing that it generates 3 files whose one is a .c file where you can see all the configuration that you have done with the interface.

here is the configuration done in C:

MCBSP_Config mcbspCfg1 = {
0x4000, /* Serial Port Control Register 1 */
0x0000, /* Serial Port Control Register 2 */
0x0080, /* Receive Control Register 1 */
0x0000, /* Receive Control Register 2 */
0x0080, /* Transmit Control Register 1 */
0x0000, /* Transmit Control Register 2 */
0x0000, /* Sample Rate Generator Register 1 */
0x2000, /* Sample Rate Generator Register 2 */
0x0000, /* Multichannel Control Register 1 */
0x0000, /* Multichannel Control Register 2 */
0x1101, /* Pin Control Register */
...

hMcBSP0 = MCBSP_open(MCBSP_PORT0, MCBSP_OPEN_RESET);
MCBSP_config(hMcBSP0, &mcbspCfg1);

So the SPSAn is automatically done when using CSL.

I hope it can help you to see what i am doing.

Thanks,

sebastien
Sebastien-

> >How do use DSP/BIOS config to "open" a McBSP? If you search the C5000 >DSP/BIOS API
> >Reference Guide:
> > http://focus.ti.com/lit/ug/spru404g/spru404g.pdf
> >there are no references to McBSP APIs. So you must be doing something else >-- what?
> >Using CSL?
> >I assume that C54x CSL functions would handle SPSAn registers correctly, but >it's not
> >clear to me what you're actually doing. Suggest to post a small piece of >your C code
> >that opens/initializes McBSP0.
> >-Jeff
>
> I'm using Code Composer Studio 3.1. I'm using the interface tool DSP/Bios configuration. File ->New -> DSP/Bios configuration. (http://www.mne.psu.edu/brennan/ME597D%20Mechatronics/Lesson_009_RealTimeSystemConcepts/DSP%20Bios%20Users%20Guide%20_%20spru423b.pdf)
> p 25 you can see the interface that i have. Thus, using this interface, you can open and configure McBsp, Dma and others pretty easily.
> When doing that it generates 3 files whose one is a .c file where you can see all the configuration that you have done with the interface.
>
> here is the configuration done in C:
>
> MCBSP_Config mcbspCfg1 = {
> 0x4000, /* Serial Port Control Register 1 */
> 0x0000, /* Serial Port Control Register 2 */
> 0x0080, /* Receive Control Register 1 */
> 0x0000, /* Receive Control Register 2 */
> 0x0080, /* Transmit Control Register 1 */
> 0x0000, /* Transmit Control Register 2 */
> 0x0000, /* Sample Rate Generator Register 1 */
> 0x2000, /* Sample Rate Generator Register 2 */
> 0x0000, /* Multichannel Control Register 1 */
> 0x0000, /* Multichannel Control Register 2 */
> 0x1101, /* Pin Control Register */
> ...
>
> hMcBSP0 = MCBSP_open(MCBSP_PORT0, MCBSP_OPEN_RESET);
> MCBSP_config(hMcBSP0, &mcbspCfg1);
>
> So the SPSAn is automatically done when using CSL.

Yes it should, but I suggest not to get overconfident using visual CSL
configuration. From an overall debug perspective, you are generating a lot of code
just to test a simple serial port function and read a couple of bits, so there's
plenty of chances to go wrong.

First, what code do you use to enable the serial port? The code above shows that you
leave serial port Rx in reset (SPCR1 = 0x4000).

Second, to verify your code is actually doing something, you should run your program
and put a breakpoint just *after* this line:

MCBSP_config(hMcBSP0, &mcbspCfg1);

then use CCS register window or memory view to read the McBSP0 registers (including
SPSA0) and ensure they are set correctly. You should be able to set SPSA0 manually
and see that each register has the value you expect. And of course, when allowing
code to run past the breakpoint, SPSA0 should be left pointing to SPCR1 if you expect
to read RRDY.

-Jeff