Reply by Steve Baker November 3, 20082008-11-03
I'm afraid I tried this long ago. TI's technical support team haven't responded to any topics on the McBSP, so it seems I've reached the end of the line. I'm just going to migrate to another company's products (most likely motorola/freescale). My research group is growing too impatient with the current equipment and lack of progress. Thank you all for your suggestions and help.

________________________________
From: "j...@yahoo.com"
To: c...
Sent: Monday, October 20, 2008 5:41:16 PM
Subject: [c54x] Re: McBSP initialization

I'm attempting to set up McBSP using code composer v3.1 with a C5416, and can't even get the simple setup from the dma4.c or mcbsp.c to work. I created the configurations I wanted, and used the code provided in dma4.c as a template to open the mcbsp channel and start everything, and the code always stops at this line.
>
>while(!(MCBSP_ xrdy(myhMcbsp) )){
> ;
> }
>
>I'm not sure why the xrdy signal is never high. Is this a common problem in the initialization phase?
>
>----------- --------- --------- -------
>
>OMAP35x EVM jump-starts low-power apps
>----------- --------- --------- -------
>The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building applications based on the OMAP35x architecture: http://www.DSPRelat ed.com/omap35x

Bending a McBSP to your will takes fortitude -- but I have done it a fair amount on 54x and 55x. My semi-educated guess is you don't have a serial clock/frame generator enabled to send the bits, so xrdy never transitions. You could try enabling the frame sync generator in your start statement. (Beware, my CSL syntax is 55x and may not be exactly correct for 54x)

MCBSP_start( hMcbsp0,MCBSP_ SRGR_FRAMESYNC, 0);

GL, Fred

Reply by jfcl...@yahoo.com October 21, 20082008-10-21
I'm attempting to set up McBSP using code composer v3.1 with a C5416, and can't even get the simple setup from the dma4.c or mcbsp.c to work. I created the configurations I wanted, and used the code provided in dma4.c as a template to open the mcbsp channel and start everything, and the code always stops at this line.
>
>while(!(MCBSP_xrdy(myhMcbsp))){
> ;
> }
>
>I'm not sure why the xrdy signal is never high. Is this a common problem in the initialization phase?
>


Bending a McBSP to your will takes fortitude -- but I have done it a fair amount on 54x and 55x. My semi-educated guess is you don't have a serial clock/frame generator enabled to send the bits, so xrdy never transitions. You could try enabling the frame sync generator in your start statement. (Beware, my CSL syntax is 55x and may not be exactly correct for 54x)

MCBSP_start(hMcbsp0,MCBSP_SRGR_FRAMESYNC,0);

GL, Fred
Reply by Steve Baker October 20, 20082008-10-20
OK, I did originally have a delay in there, though I tried several
values to see if it would work, which it didn't. Here's my
configuration:

MCBSP_Config my_mcbspConfig = {
0x8000, // spcr1
0x0000, // spcr2
0x0040, // rcr1
0x0041, // rcr2
0x0040, // xcr1
0x0041, // xcr2
0x0000, // srgr1
0x2000, // srgr2
0x0000, // mcr1
0x0000, // mcr2
0x0a00, // pcr
0x0000u, // RCERA
0x0000u, // RCERB
0x0000u, // XCERA
0x0000u, // XCERB
};

I configure the McBSP to start with XRST and RRST in reset, and then
pull them out later. The code I've been using to do this is below.

/* Open MCBSP channel 0 */
myhMcbsp = MCBSP_open(MCBSP_PORT0, MCBSP_OPEN_RESET);

/* Write configuration values to MCBSP 0 control registers */
MCBSP_config(myhMcbsp, &my_mcbspConfig);

/* Take MCBSP transmit and receive out of reset */
MCBSP_start(myhMcbsp,
MCBSP_RCV_START | MCBSP_XMIT_START,
0x200
);

The next line is the statement that polls the XRDY bit, which is never
1. I've read through all of the McBSP section of SPRU302b, which
differs from the code I have above only by the fact that they say to
program the McBSP registers, wait 2 bit clocks, set up data acquisition
by writing a value to DXR, and then set XRST and RRST to 1.

Why it is that the help contents/built-in examples that came with CCS
and this manual differ is a mystery to me. At this point, nothing
really works, and I can't really tell which document contains the
correct information. In any case, if anyone knows the rather simple
procedure to pull the transmitter and receiver out of reset, I would
very greatly appreciate it. Thanks.

----- Original Message ----
From: Steve Baker
To: j...@gmail.com
Cc: c...
Sent: Thursday, October 9, 2008 1:30:27 PM
Subject: Re: [c54x] McBSP initialization
Well, the fact is that both our configurations put the transmitter and receiver in reset, as specified in SPCR1 and SPCR2. I then attempt to take them out of reset when I'm ready to start transmitting/ receiving using the command,

MCBSP_start( myhMcbsp, MCBSP_RCV_START | MCBSP_XMIT_START, 0);

The code I gave in my first post then followed this, where the XRDY bit is polled before any data is written to the DXR. The problem is the code above isn't taking the transmitter and receiver out of reset. Maybe I'll just configure them to start out of reset and try testing.

----- Original Message ----
From: Jaime Sempere
To: Steve Baker
Cc: c54x@yahoogroups. com
Sent: Wednesday, October 8, 2008 3:58:35 PM
Subject: Re: [c54x] McBSP initialization

Sorry I was wrong, I should have said "rts.lib" not rtc.src, you should only add to the proyect, and try if it works. Maybe you should not need it, but try it... anyway I do not know too much about dsp so maybe I am saying a silly thing xD. But I think that I had problems withouth adding this library in the past. Yes, I am using the c5416 but old version of CCS (2.10).

Good luck

2008/10/8 Steve Baker

Jaime,

Thanks for providing your configuration. Mine is similar with exception of certain parameters such as bit delays, and RCR and XCR register values, since I'm handling 16 bit data. My configuration also currently calls for digital loopback mode, since I'm merely testing it at this point. As for adding rts.src to my project, I did not do this. I attempted to do it after reading your post, only to find that it does not allow my project to build while added to the project. Are you using the same software/hardware as me (CCSv3.1, C5416)? Does your project use DSP/BIOS? I've never had to add rts.src before, nor have I had to add the rts_ext.lib file. I've only had to specify my desire to make far calls in the DSB/BIOS .cdb file.

----- Original Message ----
From: Jaime Sempere
To: thedoctor152003@ yahoo.com
Cc: c54x@yahoogroups. com
Sent: Tuesday, October 7, 2008 6:28:13 PM
Subject: Re: [c54x] McBSP initialization

Hello, I do not know what is written in dma4.c or mcbsp.c, but if this
could help you...
I am working with mcbsp in 32 bits format and others features, the
only thing that I do to configure is this:

McBSP2_SPSA= SPCR1x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= SPCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= RCR1x; McBSP2_SPSD= 0x01a0;\
McBSP2_SPSA= RCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= XCR1x; McBSP2_SPSD= 0x01a0;\
McBSP2_SPSA= XCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= SRGR1x; McBSP2_SPSD= 0x1F00;\
McBSP2_SPSA= SRGR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= MCR1x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= MCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= PCRx; McBSP2_SPSD= 0x0003;\

and you must add rts.src too to the project (I think this could be
obvious for you but I did not notice the first time when I was programming
in C).
Sorry if this do not help you... try to give more information the
next time, if this not help you.

Good luck

2008/10/7

> I'm attempting to set up McBSP using code composer v3.1 with a C5416,
> and can't even get the simple setup from the dma4.c or mcbsp.c to work. I
> created the configurations I wanted, and used the code provided in dma4.c as
> a template to open the mcbsp channel and start everything, and the code
> always stops at this line.
>
> while(!(MCBSP_ xrdy(myhMcbsp) )){
> ;
> }
>
> I'm not sure why the xrdy signal is never high. Is this a common problem in
> the initialization phase?
Reply by Steve Baker October 9, 20082008-10-09
Well, the fact is that both our configurations put the transmitter and receiver in reset, as specified in SPCR1 and SPCR2. I then attempt to take them out of reset when I'm ready to start transmitting/receiving using the command,

MCBSP_start(myhMcbsp, MCBSP_RCV_START | MCBSP_XMIT_START, 0);

The code I gave in my first post then followed this, where the XRDY bit is polled before any data is written to the DXR. The problem is the code above isn't taking the transmitter and receiver out of reset. Maybe I'll just configure them to start out of reset and try testing.

----- Original Message ----
From: Jaime Sempere
To: Steve Baker
Cc: c...
Sent: Wednesday, October 8, 2008 3:58:35 PM
Subject: Re: [c54x] McBSP initialization

Sorry I was wrong, I should have said "rts.lib" not rtc.src, you should only add to the proyect, and try if it works. Maybe you should not need it, but try it... anyway I do not know too much about dsp so maybe I am saying a silly thing xD. But I think that I had problems withouth adding this library in the past. Yes, I am using the c5416 but old version of CCS (2.10).

Good luck
2008/10/8 Steve Baker

Jaime,

Thanks for providing your configuration. Mine is similar with exception of certain parameters such as bit delays, and RCR and XCR register values, since I'm handling 16 bit data. My configuration also currently calls for digital loopback mode, since I'm merely testing it at this point. As for adding rts.src to my project, I did not do this. I attempted to do it after reading your post, only to find that it does not allow my project to build while added to the project. Are you using the same software/hardware as me (CCSv3.1, C5416)? Does your project use DSP/BIOS? I've never had to add rts.src before, nor have I had to add the rts_ext.lib file. I've only had to specify my desire to make far calls in the DSB/BIOS .cdb file.

----- Original Message ----
From: Jaime Sempere
To: thedoctor152003@ yahoo.com
Cc: c54x@yahoogroups. com
Sent: Tuesday, October 7, 2008 6:28:13 PM
Subject: Re: [c54x] McBSP initialization
Hello, I do not know what is written in dma4.c or mcbsp.c, but if this
could help you...
I am working with mcbsp in 32 bits format and others features, the
only thing that I do to configure is this:

McBSP2_SPSA= SPCR1x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= SPCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= RCR1x; McBSP2_SPSD= 0x01a0;\
McBSP2_SPSA= RCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= XCR1x; McBSP2_SPSD= 0x01a0;\
McBSP2_SPSA= XCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= SRGR1x; McBSP2_SPSD= 0x1F00;\
McBSP2_SPSA= SRGR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= MCR1x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= MCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= PCRx; McBSP2_SPSD= 0x0003;\

and you must add rts.src too to the project (I think this could be
obvious for you but I did not notice the first time when I was programming
in C).
Sorry if this do not help you... try to give more information the
next time, if this not help you.

Good luck

2008/10/7

> I'm attempting to set up McBSP using code composer v3.1 with a C5416,
> and can't even get the simple setup from the dma4.c or mcbsp.c to work. I
> created the configurations I wanted, and used the code provided in dma4.c as
> a template to open the mcbsp channel and start everything, and the code
> always stops at this line.
>
> while(!(MCBSP_ xrdy(myhMcbsp) )){
> ;
> }
>
> I'm not sure why the xrdy signal is never high. Is this a common problem in
> the initialization phase?
Reply by Jaime Sempere October 8, 20082008-10-08
Sorry I was wrong, I should have said "rts.lib" not rtc.src, you
should only add to the proyect, and try if it works. Maybe you should not
need it, but try it... anyway I do not know too much about dsp so maybe I am
saying a silly thing xD. But I think that I had problems withouth adding
this library in the past. Yes, I am using the c5416 but old version of CCS
(2.10).

Good luck

2008/10/8 Steve Baker

> Jaime,
>
> Thanks for providing your configuration. Mine is similar with exception of
> certain parameters such as bit delays, and RCR and XCR register values,
> since I'm handling 16 bit data. My configuration also currently calls for
> digital loopback mode, since I'm merely testing it at this point. As for
> adding rts.src to my project, I did not do this. I attempted to do it after
> reading your post, only to find that it does not allow my project to build
> while added to the project. Are you using the same software/hardware as me
> (CCSv3.1, C5416)? Does your project use DSP/BIOS? I've never had to add
> rts.src before, nor have I had to add the rts_ext.lib file. I've only had
> to specify my desire to make far calls in the DSB/BIOS .cdb file.
>
> ----- Original Message ----
> From: Jaime Sempere
> To: t...@yahoo.com
> Cc: c...
> Sent: Tuesday, October 7, 2008 6:28:13 PM
> Subject: Re: [c54x] McBSP initialization
>
> Hello, I do not know what is written in dma4.c or mcbsp.c, but if this
> could help you...
> I am working with mcbsp in 32 bits format and others features, the
> only thing that I do to configure is this:
>
> McBSP2_SPSA= SPCR1x; McBSP2_SPSD= 0x0000;\
> McBSP2_SPSA= SPCR2x; McBSP2_SPSD= 0x0000;\
> McBSP2_SPSA= RCR1x; McBSP2_SPSD= 0x01a0;\
> McBSP2_SPSA= RCR2x; McBSP2_SPSD= 0x0000;\
> McBSP2_SPSA= XCR1x; McBSP2_SPSD= 0x01a0;\
> McBSP2_SPSA= XCR2x; McBSP2_SPSD= 0x0000;\
> McBSP2_SPSA= SRGR1x; McBSP2_SPSD= 0x1F00;\
> McBSP2_SPSA= SRGR2x; McBSP2_SPSD= 0x0000;\
> McBSP2_SPSA= MCR1x; McBSP2_SPSD= 0x0000;\
> McBSP2_SPSA= MCR2x; McBSP2_SPSD= 0x0000;\
> McBSP2_SPSA= PCRx; McBSP2_SPSD= 0x0003;\
>
> and you must add rts.src too to the project (I think this could be
> obvious for you but I did not notice the first time when I was programming
> in C).
> Sorry if this do not help you... try to give more information the
> next time, if this not help you.
>
> Good luck
>
> 2008/10/7 > > I'm attempting to set up McBSP using code composer v3.1 with a C5416,
> > and can't even get the simple setup from the dma4.c or mcbsp.c to work. I
> > created the configurations I wanted, and used the code provided in dma4.c
> as
> > a template to open the mcbsp channel and start everything, and the code
> > always stops at this line.
> >
> > while(!(MCBSP_ xrdy(myhMcbsp) )){
> > ;
> > }
> >
> > I'm not sure why the xrdy signal is never high. Is this a common problem
> in
> > the initialization phase?
> >
> >
Reply by Steve Baker October 8, 20082008-10-08
Jaime,

Thanks for providing your configuration. Mine is similar with exception of certain parameters such as bit delays, and RCR and XCR register values, since I'm handling 16 bit data. My configuration also currently calls for digital loopback mode, since I'm merely testing it at this point. As for adding rts.src to my project, I did not do this. I attempted to do it after reading your post, only to find that it does not allow my project to build while added to the project. Are you using the same software/hardware as me (CCSv3.1, C5416)? Does your project use DSP/BIOS? I've never had to add rts.src before, nor have I had to add the rts_ext.lib file. I've only had to specify my desire to make far calls in the DSB/BIOS .cdb file.

----- Original Message ----
From: Jaime Sempere
To: t...@yahoo.com
Cc: c...
Sent: Tuesday, October 7, 2008 6:28:13 PM
Subject: Re: [c54x] McBSP initialization
Hello, I do not know what is written in dma4.c or mcbsp.c, but if this
could help you...
I am working with mcbsp in 32 bits format and others features, the
only thing that I do to configure is this:

McBSP2_SPSA= SPCR1x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= SPCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= RCR1x; McBSP2_SPSD= 0x01a0;\
McBSP2_SPSA= RCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= XCR1x; McBSP2_SPSD= 0x01a0;\
McBSP2_SPSA= XCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= SRGR1x; McBSP2_SPSD= 0x1F00;\
McBSP2_SPSA= SRGR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= MCR1x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= MCR2x; McBSP2_SPSD= 0x0000;\
McBSP2_SPSA= PCRx; McBSP2_SPSD= 0x0003;\

and you must add rts.src too to the project (I think this could be
obvious for you but I did not notice the first time when I was programming
in C).
Sorry if this do not help you... try to give more information the
next time, if this not help you.

Good luck

2008/10/7

> I'm attempting to set up McBSP using code composer v3.1 with a C5416,
> and can't even get the simple setup from the dma4.c or mcbsp.c to work. I
> created the configurations I wanted, and used the code provided in dma4.c as
> a template to open the mcbsp channel and start everything, and the code
> always stops at this line.
>
> while(!(MCBSP_ xrdy(myhMcbsp) )){
> ;
> }
>
> I'm not sure why the xrdy signal is never high. Is this a common problem in
> the initialization phase?
Reply by Jaime Sempere October 7, 20082008-10-07
Hello, I do not know what is written in dma4.c or mcbsp.c, but if this
could help you...
I am working with mcbsp in 32 bits format and others features, the
only thing that I do to configure is this:
McBSP2_SPSA=SPCR1x; McBSP2_SPSD=0x0000;\
McBSP2_SPSA=SPCR2x; McBSP2_SPSD=0x0000;\
McBSP2_SPSA=RCR1x; McBSP2_SPSD=0x01a0;\
McBSP2_SPSA=RCR2x; McBSP2_SPSD=0x0000;\
McBSP2_SPSA=XCR1x; McBSP2_SPSD=0x01a0;\
McBSP2_SPSA=XCR2x; McBSP2_SPSD=0x0000;\
McBSP2_SPSA=SRGR1x; McBSP2_SPSD=0x1F00;\
McBSP2_SPSA=SRGR2x; McBSP2_SPSD=0x0000;\
McBSP2_SPSA=MCR1x; McBSP2_SPSD=0x0000;\
McBSP2_SPSA=MCR2x; McBSP2_SPSD=0x0000;\
McBSP2_SPSA=PCRx; McBSP2_SPSD=0x0003;\

and you must add rts.src too to the project (I think this could be
obvious for you but I did not notice the first time when I was programming
in C).
Sorry if this do not help you... try to give more information the
next time, if this not help you.

Good luck
2008/10/7

> I'm attempting to set up McBSP using code composer v3.1 with a C5416,
> and can't even get the simple setup from the dma4.c or mcbsp.c to work. I
> created the configurations I wanted, and used the code provided in dma4.c as
> a template to open the mcbsp channel and start everything, and the code
> always stops at this line.
>
> while(!(MCBSP_xrdy(myhMcbsp))){
> ;
> }
>
> I'm not sure why the xrdy signal is never high. Is this a common problem in
> the initialization phase?
>
>
Reply by thed...@yahoo.com October 7, 20082008-10-07
I'm attempting to set up McBSP using code composer v3.1 with a C5416, and can't even get the simple setup from the dma4.c or mcbsp.c to work. I created the configurations I wanted, and used the code provided in dma4.c as a template to open the mcbsp channel and start everything, and the code always stops at this line.

while(!(MCBSP_xrdy(myhMcbsp))){
;
}

I'm not sure why the xrdy signal is never high. Is this a common problem in the initialization phase?