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.

How to configure McBSP to get 4 words of data sequentially (McBSP only getting 15 bits of data - not 16)?

Hello,

I have a McBSP port connected to DMA on my 28346 DSP.  The McBSP is connected to an external ADC device, and the McBSP is configured as a SPI master.

The ADC will signal the DMA when it is done with it's conversion, at which time I want the DMA to copy out 4 16-bit words from the McBSP/SPI port into memory.  Pretty standard stuff I think.

I almost have this working, but not quite.  I have everything set up, and I thought I had configured my McBSP to have a length of 4 16-bit words by doing the following:

regs->XCR1.all=0x0;

regs->XCR1.bit.XWDLEN1=2; // 16-bit word
regs->XCR1.bit.XFRLEN1=3; // Set the Transmit Frame Length to 4 words in phase 1
regs->RCR1.all=0x0;
regs->RCR1.bit.RWDLEN1=2; // 16-bit word
regs->RCR1.bit.RFRLEN1=3; // Set the Recieve Frame Length to 4 words in phase 1

As I said, 4 16 bit words in the transmission.  The document is very clear that setting XWDLEN and RFRLEN to 2 (10b) you will get a 16 bit word.  However, when I scope the data, I am seeing that the first word gets 16 bits of clock pulse, but the remaining 3 words are only getting 15 clock pulses - 15 bits!  So of course the data I read off the SPI is messed up!  I think I will ask this question separately on the forum unless you know what is going on here?

So I am close, but not fully there yet.

Does anyone know why the port is sending only 15 bits when it is configured for 16 bits?  Is there some configuration I have missed for this?  I am hoping it is something simple!

Thanks for the help.

-Jeff

  • Just to follow back up on this - I figured out what the problem was.  I needed to change the Clock Stop Bit (CLKSTP) in order to get this to work.

    What I was seeing on the scope was 16bits of clock followed by a small pause, followed by 15 bits of clock until the 4th word.  I had the CLKSTP bit set to 10b, and I thought that the no delay might be causing the problem.  I changed the setting to 11b to put in clock delay, and as sson as I did that, I saw that the gap between words was eliminated, and that I was able to transmit 64 bits of clock sequentially with no gaps.

    So if you ever want to transmit more than 16 bits continuously on the McBSP port, you should set the CLKSTP bit to 11b.

    -Jeff