[comp.sys.next] Help Needed about DSP C functions...

philwzo@quiche.cs.mcgill.ca (Philippe WIECZOREK) (11/13/90)

	Is there anyone who can tell me anything about the DSP system C
	functions ? Especially teh functions used to write and read data
	in or from the DSP. ( DSPWrite...Array, DSPRead...Array)

	I have trouble with understanding the organisation of the DSP
	memory too... Is someone able to explain it to me ?

	Any comments would help a lot...
	
	Thank you very much.


     ==============================================================
    / Philippe WIECZOREK.          | e-mail : philwzo@cs.mcgill.ca \
   /  Speech Lab.                  | phone  : (514) 284-0398        \
  /   McGill University, Montreal. | Only NeXT makes it possible !   \
  ====================================================================

Eric.Thayer@cs.cmu.edu (Eric H. Thayer) (11/15/90)

Admittedly, this stuff is a little daunting the first time out.  There are 
a number of ways to communicate to the DSP.   My suggestion is to dig into 
the example code provided in
/NextDeveloper/Examples/DSP/SoundDSPDriver/dsp_example_[1234].  This code 
works (with one change that I am aware of).  You can do timings and 
performance analysis of communcation overheads/throughput using this code. 
 From that, you can decide how much coding complexity you are willing to 
live with given the constraints of your application.

The code that needs to change is the bit where the device and owner ports 
are acquired/released.  You should look up the summaries for SNDAcquire 
and SNDRelease and replace the existing code with calls to SNDAcquire and 
SNDRelease.  If you don't do this, things you build using the example code 
don't interact well with code that uses SNDAcquire and SNDRelease (I am 
not sure why, but NeXT recommended I use SNDAcquire/SNDRelease instead of 
what is shown in the demo code).  Thankfully, this has been fixed in the 
example code in prerelease 2.0.

 Also, DEFINITELY get the DSP56000 UM/AD (User's Manual) and be thankful 
that you are working from a Rev 2 manual and not a Rev 0 manual.

 This is basically how I got bootstrapped (with some help from some 
friends). 

In article <10@homer.cs.mcgill.ca> philwzo@quiche.cs.mcgill.ca (Philippe 
WIECZOREK) writes:
>         I have trouble with understanding the organisation of the DSP
>         memory too... Is someone able to explain it to me ?

Can you be more specific?



----------------------------------
Replies can have NeXT attachments in them
Phone: (412)268-7679

philwzo@quiche.cs.mcgill.ca (Philippe WIECZOREK) (11/15/90)

	First of all, I would like to thank all people who took the time
	to answer my questions.

	I need now more specific information about data transfers from
	the NeXT memory to the DSP one. For example, I would be very
	thankful to anyone who could give me a description of the
	functions which write and read information in the DSP... There
	is nearly no documentation on these functions in the NeXT's
	manuals (versions 0.9 and 1.0).

	I did not manage to write a float number greater than 1.0 on the
	DSP... I think it is a problem of representation between C and
	DSP. If so, what is the DSP float format ?

	Any suggestions, comments, ideas will be very useful and
	appreciated...


	Thank you.



		Phil.


     ==============================================================
    / Philippe WIECZOREK.          | e-mail : philwzo@cs.mcgill.ca \
   /  Speech Lab.                  | phone  : (514) 284-0398        \
  /   McGill University, Montreal. | Only NeXT makes it possible !   \
  ====================================================================

Eric.Thayer@cs.cmu.edu (Eric H. Thayer) (11/16/90)

In article <26@homer.cs.mcgill.ca> philwzo@quiche.cs.mcgill.ca (Philippe 
WIECZOREK) writes:
> I did not manage to write a float number greater than 1.0 on the
>         DSP... I think it is a problem of representation between C and
>         DSP. If so, what is the DSP float format ?

Get the 56k User's Manual.  You may find that you will be at a 
disadvantage if you don't get the DSP56000 UM/AD (User's Manual).   
Another helpful document from Motorola is:

     APR3/D "Fractional and Integer Arithmetic Using the DSP56000 Family 
of  General-Purpose Digital Signal Processors"


This explains the "mystery" of the way the 56k represents numbers.  It 
also gives some helpful algorithms for implementing other representations 
given the 56k's primitive representation.




----------------------------------
Replies can have NeXT attachments in them
Phone: (412)268-7679

jfreem@uncecs.edu (Joe Freeman) (11/17/90)

In article <1990Nov15.184711.336@cs.cmu.edu> Eric.Thayer@cs.cmu.edu (Eric H. Thayer) writes:
>
>In article <26@homer.cs.mcgill.ca> philwzo@quiche.cs.mcgill.ca (Philippe 
>WIECZOREK) writes:
>> I did not manage to write a float number greater than 1.0 on the
>>         DSP... I think it is a problem of representation between C and
>>         DSP. If so, what is the DSP float format ?
>
>Get the 56k User's Manual.  You may find that you will be at a 
>disadvantage if you don't get the DSP56000 UM/AD (User's Manual).   
>Another helpful document from Motorola is:
>
The above sources will help you understand the math.  You will find
the 56000 does 24 bit fixed point math.  The numbers range from -1.0 to
1.0.  

<joe>

benm@microsoft.UUCP (Ben MEJIA) (11/21/90)

In article <26@homer.cs.mcgill.ca> philwzo@quiche.cs.mcgill.ca (Philippe WIECZOREK) writes:
>
>	I did not manage to write a float number greater than 1.0 on the
>	DSP... I think it is a problem of representation between C and
>	DSP. If so, what is the DSP float format ?

    The 56k uses 24-bit binary fractions (i.e. 0.01 == 1/4).  Floating
point formats are not directly supported on the 56k. Presumably NeXT
provides some way to perform floating pt. arithmetic on the 56k.

--
	bam  (benm@microsoft)