ΣSigmaStudio Ask AI Русский Log in

Initialize order for SPORT programming

Processors & DSP ThierryNolf Mar 9, 2015 00:00 1 replies Original on forum ↗
Thread Summary

Thread Summary

The user asked about the correct initialization order for two SPORTs running synchronously in multichannel mode for sending 16 channels of audio. The final answer confirmed that the multichannel transmit and receive select registers must be programmed before enabling the SPORTs, as documented in the HRM. The correct order is to set the CPSP registers and enable multichannel mode before programming and enabling the SPCTL and SPMCTL registers.
AI Generated Content
Subscribe
ThierryNolf Question
Mar 9, 2015 00:00

Hi All,

Is there any order that should be respected when initializing two SPORT's running synchronious in multi channel ?

Is that order described in any document ?

I'm using two sport's (0 and 1) to get a combination sending 16 channels audio, 16 samples per channel for each FSYNC. Each sport (a and b from 0 and 1) is sending 4 channels, 16 samples gives us 64 channels.

The data is fetched from external memory through TCB-DMA.

My sync routine is like :

1* Clear SP0CS0,SP1CS0,SPCTL0,SPMCTL0,SPCTL1,SPMCTL1

2* Set CPSP0A and pCPSP0B

3* Program and enable SPCTL0 and SPMCTL0

4* Set CPSP1A and pCPSP1B

5* Program and enable SPCTL1 and SPMCTL1

6* Enable multi channels SP0CS0,SP0CS1,SP1CS0,SP0CS1

I re-do this init routine to reset the sport after a new audio sample frequency is selected. This gives wrong output in 1 case at +/- 200 selections. By changing the order to :

1* Clear SP0CS0,SP1CS0,SPCTL0,SPMCTL0,SPCTL1,SPMCTL1

2* Set CPSP0A and pCPSP0B and CPSP1A and pCPSP1B

3* Enable multi channels SP0CS0,SP0CS1,SP1CS0,SP0CS1

4* Program and enable SPCTL0 and SPMCTL0

5* Program and enable SPCTL1 and SPMCTL1

Now it seems to work all the time.

I cannot find any spec in the order and timing for setting the registers.

Is my assumption correct and should there be an order that I should keep in mind ?

Thanks,

Br,

Thierry

jobo23 Reply
Mar 13, 2015 00:00

When using the multichannel mode of operation, the multichannel transmit and receive select registers must be programmed before the SPORT is enabled; therefore, your first sequence is incorrect, and you have correctly changed this in the second sequence. Given the names of the registers you reference, I assume this is for a SHARC processor...though I am not sure which one, the same is true for all of the most recent SHARC products...the documentation indicating this ordering can be found in the HRM in the SPORT chapter under the "Programming Model" section, specifically under the "Setting Up and Starting Multichannel Mode" heading. Using the ADSP-2137x as an example, this is on p7-57:

http://www.analog.com/media/en/dsp-documentation/processor-manuals/ADSP-2137x_hwr_rev2.2.pdf

-Joe