This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

McBSP to McBSP communication across 2 beagle boards.



Hi

We want to transfer data over McBSP from one board to another board ( with 2MBps or 2MHz clock). It is only one-way ( Board-Tx will send to Board-Rx)

Here are the signals used to connect the boards.

Board-Tx                       Board-Rx

FSX                                FSR

DX                                  DR

We want to use internal clock for both boards but use external FSR on Board-Rx

Here is the configuration for Board-Tx and Board-Rx

Board-Tx:

    xcr1 |= XWDLEN1(OMAP_MCBSP_WORD_8);
    xcr1 |= XFRLEN1(0);
    xcr2 |= XDATDLY(0);

    pcr0 |= FSXM;
    pcr0 |= CLKXM;
   
    spcr2 |=XINTM(3);
    spcr2 |=GRST;
    spcr2 |=FRST;
    xccr |= XDMAEN; // Enable DMA transmitt requests

    xcerc = 0x1;

    srgr1 |= CLKGDV(47); // 96 MHz / 48 = 2 MHz clock
    srgr1 |= FWID(8);
    srgr2 |= CLKSM;
    srgr2 |= FPER(7);

Board-Rx:

    spcr1 &= ~ RRST;       // reset state
    rcr1 |= RWDLEN1(OMAP_MCBSP_WORD_8);
    rcr1 |= RFRLEN1(0);
    rcr2 |= RDATDLY(0);

   pcr0 |= CLKRM;
   spcr1 |=RINTM(3);
   spcr2 |=GRST;
   spcr2 |=FRST;
   rccr |= RDMAEN; // Enable DMA receive requests
   rcerc = 0x1;
   spcr1 |= RRST;         // out of reset

    srgr1 |= CLKGDV(47); // 96 MHz / 48 = 2 MHz clock
    srgr1 |= FWID(8);
    srgr2 |= CLKSM;
    srgr2 |= FPER(7);

We are seeing that the receiver is getting extra data or some times data is missed ?

Is there some thing which we are doing wrong ? (both configuration and Hardware connections).

Is there any project or any sample code which can achieve the above requirement.

Eswar

  • Hi Eswar,

    We should try to analyze the nature of the errors:

    If the errors appears as missed bit, extra bits or wrong bits the problem is possible due hardware or cables. What is the length of the cables between boards? Try to use shorted cables.

    If the errors appears as repeated bytes it is possible the tx buffer become empty. When the tx buffer is empty the last transmitted byte repeats.

    The lost of byte could be due to overwriting of tx buffer or incorrect handling of rx buffer.

    BR

    Tsvetolin Shulev

  • Hello Tsvetolin Shulev,

      Thanks for the reply. We are transferring 32 bytes of data. In the receiver we are receiving 32 Bytes of data. The problem is we are receiving Wrong data some times.

    Our Cable length is 15cm(centimetre). For example we sent 0x11 and in the receiver we received as follows

    i=0 val=11
    i=1 val=11
    i=2 val=11
    i=3 val=10
    i=4 val=11
    i=5 val=11
    i=6 val=11
    i=7 val=11
    i=8 val=11
    i=9 val=11
    i=10 val=11
    i=11 val=11
    i=12 val=11
    i=13 val=11
    i=14 val=11
    i=15 val=11
    i=16 val=10
    i=17 val=11
    i=18 val=89
    i=19 val=11
    i=20 val=11
    i=21 val=9
    i=22 val=10
    i=23 val=11
    i=24 val=11
    i=25 val=11
    i=26 val=11
    i=27 val=11
    i=28 val=11
    i=29 val=11
    i=30 val=10
    i=31 val=11

    These changed values not same in the next packet.

    So, Where we are missing the configuration? How to solve this issue?


    Thanks Regards

    Eswar

  • The received sequence seems like synchronization lost or some hardware issue.I could not find mistake in the configuration.

    BR

    Tsvetolin Shulev

  • Hi Eswar,

    Could you please try capturing data into a buffer and compare? sometimes printf misses the recieved data.
    Also could you please check for error bits(overflow/underflow)

    Thanks!!

    Regards
    Sathish

  • Hello Sathish,

      Thanks for the pointers. We will try and implement .

    Thanks Regards

    Eswar