DSPRelated.com
Forums

Interfacing with MCBSP on the 5510 DSP

Started by dementedstatus January 3, 2008
Hi,

I'm having trouble performing a simple interface with the MCBSPs on
the board. My main goal right now is just to write a value to a MCBSP
and read the value back out. My main problem is although I initialize
MCBSP for both transmit and receive with MCBSP_start(hMcbsp0,
MCBSP_RCV_START | MCBSP_XMIT_START | MCBSP_SRGR_START|
MCBSP_SRGR_FRAMESYNC, 0).

After writing a value to hMcbsp0, the buffer isn't ready to let me
read from it. I always get a 0 for MCBSP_rrdy(hMcbsp0), but I get a 1
for MCBSP_xrdy(hMcbsp0).

The header files I use are csl, csl_irq, csl_mcbsp, dsk5510.

Any suggestions?

Thank you,
Sammy
You must make sure that the device on the other end has send you something.
----- ԭʼ ----
dementedstatus
c...
2008/1/4(), 4:59:45
[c55x] Interfacing with MCBSP on the 5510 DSP

Hi,

I'm having trouble performing a simple interface with the MCBSPs on
the board. My main goal right now is just to write a value to a MCBSP
and read the value back out. My main problem is although I initialize
MCBSP for both transmit and receive with MCBSP_start( hMcbsp0,
MCBSP_RCV_START | MCBSP_XMIT_START | MCBSP_SRGR_START|
MCBSP_SRGR_FRAMESYN C, 0).

After writing a value to hMcbsp0, the buffer isn't ready to let me
read from it. I always get a 0 for MCBSP_rrdy(hMcbsp0) , but I get a 1
for MCBSP_xrdy(hMcbsp0) .

The header files I use are csl, csl_irq, csl_mcbsp, dsk5510.

Any suggestions?

Thank you,
Sammy

I've been trying to wait for it and I don't think the MCBSPs have ever
returned a 1 for the MCBSP_rrdy(). I actually have a question
regarding which value I'm suppose to wait for from the MCBSP_rrdy().
>From the examples I've looked at, I see users use "while
(!MCBSP_rrdy(Mcbsp0))" and then read from the buffers, but if
MCBSP_rrdy()=0, doesn't that mean that the buffers are not ready to be
read? And wouldn't the statements within the while loop be reading
from the buffers when rrdy=0?

The point of my code is to just write to a buffer, hMcbsp0, and read
back that value from it. The code I have is pasted below.

I'm not sure if I have everything correctly. The MCBSP_Open and
MCBSP_Config are declared in some other files that were generated
using the cdb file that I have. Within it has the config and open
declarations. It's called through the "DAC8831_5510cfg.h."

/*Declarations*/
#define BLOCK_SZ 1024 /* size of data buffer */

/* CSL device build option */
#define CHIP_5510PG2_2 (1)

/* Header file */
#include "csl.h"
#include "csl_irq.h"
#include "csl_mcbsp.h"
#include "dsk5510.h"
#include
#include

#include "DAC8831_5510cfg.h"

volatile Uint16 k;

void main() {

Uint16 i=2, j;

printf(" %d \n", j);
MCBSP_start(hMcbsp0, MCBSP_RCV_START | MCBSP_XMIT_START |
MCBSP_SRGR_START| MCBSP_SRGR_FRAMESYNC, 0x300u);
MCBSP_write(hMcbsp0, i);
while (!MCBSP_rrdy(hMcbsp0)){
k = MCBSP_read(hMcbsp0);
printf(" %d \n", k);
}
}

Please let me know if you have any suggestions or additions I need to
make to read from the buffer.

Thanks,
Sammy

Check Out Industrys First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467

hMcbsp0 is not a buffer, it's a handle to Mcbsp.
To read the data back, you have to set the port in
loopback mode. Or wire the transmit signals to the
recive pins.

--- dementedstatus д

> I've been trying to wait for it and I don't think
> the MCBSPs have ever
> returned a 1 for the MCBSP_rrdy(). I actually have a
> question
> regarding which value I'm suppose to wait for from
> the MCBSP_rrdy().
> From the examples I've looked at, I see users use
> "while
> (!MCBSP_rrdy(Mcbsp0))" and then read from the
> buffers, but if
> MCBSP_rrdy()=0, doesn't that mean that the buffers
> are not ready to be
> read? And wouldn't the statements within the while
> loop be reading
> from the buffers when rrdy=0?
>
> The point of my code is to just write to a buffer,
> hMcbsp0, and read
> back that value from it. The code I have is pasted
> below.
>
> I'm not sure if I have everything correctly. The
> MCBSP_Open and
> MCBSP_Config are declared in some other files that
> were generated
> using the cdb file that I have. Within it has the
> config and open
> declarations. It's called through the
> "DAC8831_5510cfg.h."
>
> /*Declarations*/
> #define BLOCK_SZ 1024 /* size of data buffer */
>
> /* CSL device build option */
> #define CHIP_5510PG2_2 (1)
>
> /* Header file */
> #include "csl.h"
> #include "csl_irq.h"
> #include "csl_mcbsp.h"
> #include "dsk5510.h"
> #include
> #include #include "DAC8831_5510cfg.h"
>
> volatile Uint16 k;
>
> void main() {
>
> Uint16 i=2, j;
>
> printf(" %d \n", j);
> MCBSP_start(hMcbsp0, MCBSP_RCV_START |
> MCBSP_XMIT_START |
> MCBSP_SRGR_START| MCBSP_SRGR_FRAMESYNC, 0x300u);
> MCBSP_write(hMcbsp0, i);
> while (!MCBSP_rrdy(hMcbsp0)){
> k = MCBSP_read(hMcbsp0);
> printf(" %d \n", k);
> }
> }
>
> Please let me know if you have any suggestions or
> additions I need to
> make to read from the buffer.
>
> Thanks,
> Sammy

Check Out Industrys First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467