DSPRelated.com
Forums

McBSP Clock Stop mode

Started by Brian C. Lane December 31, 2002
I'm working on using McBSP1 on a 5416 in clock stop mode as a SPI
master. I have successfully set it up so that it will transmit a block
of bytes using DMA #2, and generate an interrupt when the block is
finished.

Now I'm trying to use 2 DMA channels, one for transmit (to keep the
SPI transfer running) and another to receive the bytes. The transmit
DMA is triggered by McBSP1 transmit events and receive is triggered by
receive events. I have it setup to generate an interrupt when the
receive DMA is finished with the required number of bytes.

It works the first time (I have it in a loop, watching for one
transfer to finish before starting another). But the second time
through it outputs bytes but doesn't hit the end of block interrupt.
I've checked my McBSP setup and DMA setup and can't find anything
obvious.

As a simple case I transfer 1 byte (to get a length from the slave)
and then start the big transfer. When I just try to run the initial
single byte transfer, which uses RX to trigger it with interrupt
enabled it will hit the interrupt the first time it runs, but not the
second. If I change it to use the TX McBSP event it will work every
time. The only change in this case is to set DMSFC2 to 0x6000 (single
byte transfer, TX event driven, works) or to 0x5000 (single byte
transfer, RX event drive, only works after a reset).

Thanks for any help, ideas, etc.

Brian

-----------------
Brian C. Lane (W7BCL) Programmer
www.shinemicro.com RF, DSP & Microcontroller Design




On Tue, 31 Dec 2002 11:51:54 -0800, you wrote:

>As a simple case I transfer 1 byte (to get a length from the slave)
>and then start the big transfer. When I just try to run the initial
>single byte transfer, which uses RX to trigger it with interrupt
>enabled it will hit the interrupt the first time it runs, but not the
>second. If I change it to use the TX McBSP event it will work every
>time. The only change in this case is to set DMSFC2 to 0x6000 (single
>byte transfer, TX event driven, works) or to 0x5000 (single byte
>transfer, RX event drive, only works after a reset).

As usual, answering my own question <G>. I had an old version of the
peripheral guide printed out. The PDF version was clear that the McBSP
needs to be in reset until the DMA is setup and ready. It works now.

Brian

-----------------
Brian C. Lane (W7BCL) Programmer
www.shinemicro.com RF, DSP & Microcontroller Design