Page 1 of 1

EB085 DSP input board

Posted: Sat Dec 07, 2013 6:14 pm
by randomrichard
Hiyah!

I seem to be the first person to try out your EB085 board judging by the lack of discussion in the forum. I would be grateful if you would direct me to the test file DSP_Input.hex mentioned in the board's document. Meanwhile I shall try to do my own test...
Richard

Re: EB085 DSP input board

Posted: Tue Dec 10, 2013 3:38 pm
by Benj
Hello,

Here are the files mentioned in the datasheet. Let me know if you have any problems.

Re: EB085 DSP input board

Posted: Wed Dec 11, 2013 12:48 am
by randomrichard
Hello
Thanks for the code. The EB085 works remarkably well. The code has given me access to the type of manipulations necessary for DSP operations. I plan to use Flowcode 6 and the dsPIC33FJ128GP802 to build my sonar system based on the newly-arrived EB064, which is intended to process chirp signals, as used in radar and sonar, for greater range and precision in noisy conditions. This will supplant a working system I have built on an Arduino Due. However, despite its mighty ARM processor the Due's signal handling speed isn't up to the job.

I can't find any HELP reference to your use of variable names preceded by a dot, as in the macros you have written in the example files. But presumably this is just what one does, in macros?
Richard

Re: EB085 DSP input board

Posted: Wed Dec 11, 2013 1:04 am
by kersing
randomrichard wrote: I can't find any HELP reference to your use of variable names preceded by a dot, as in the macros you have written in the example files. But presumably this is just what one does, in macros?
Any variable with a name preceded by a dot is a local variable or a parameter for that macro and is only accessible within the macro. Variable names without a dot are global and are accessible from any macro.

Re: EB085 DSP input board

Posted: Tue May 19, 2015 3:15 pm
by SHORTCIRCUIT
Anyone who understands it please explain!

In the above flowcode program "DSP_Input.fcf" posted by Ben, in the Read_ADC macro at the bottom there is a calculation performed which I do not understand. A variable with a period before it is a local variable, OK. Is there something unique about .Return or can any variable return a local variable value into a global variable when the macro ends? Also I don't understand the shifting sequence and the or commands. It seems that the .Return can equal several different things. Will someone please explain the sequence. Also, above the calculation , the the read ADC is used via the SPI three times in succession returning each in different variables ( .upper, .mid, .lower). Why is that done, I know that it all ties together but I can't wrap my head around it. Please enlighten me. All help will definitely be appreciated.

Larry

Re: EB085 DSP input board

Posted: Wed May 20, 2015 6:03 am
by SHORTCIRCUIT
I am starting to get it. The process is combining the binary data by shifting (<<) and or (l) statements.
I still don't understand why shift 12 places, I would have thought 8 places. The digital signal processing book from the course explains it but I think the example in the book is wrong for the:
.Return = .upper<<12
Initially .upper = 10101100
and after the <<12 16bit = 1010000000000000 is this right or is it wrong. please explain.

Larry

Re: EB085 DSP input board

Posted: Wed May 20, 2015 11:38 am
by Benj
Hello Larry,
Is there something unique about .Return or can any variable return a local variable value into a global variable when the macro ends?
The .Return variable is only available when you have specified a return variable for your macro. Double click on the macro start icon and you can edit things like the parameters, return and locals.
I still don't understand why shift 12 places,
The ADC on the EB085 returns a 16-bit value but spread out over three bytes with 4 unused bits at either side of the 16-bit data. If you look at page 17 of the ADC datasheet then it should help to clear things up.

www.farnell.com/datasheets/1511560.pdf

Therefore the return variable is the combination of the 16-bit value from the 3 bytes received from the ADC.

Re: EB085 DSP input board

Posted: Wed May 20, 2015 3:05 pm
by SHORTCIRCUIT
Hi Ben

That was extremely helpful. I have a much better understanding. I do have 1 loose end.
The explanation in the DSP training manual.
Calc.jpg
(49.31 KiB) Downloaded 3821 times
If I understand it correctly, then Initially should read .upper 00001010 and not (101001100) and .lower 10000000 and not (10000001) to account for the leading and trailing 4 zeros.

Please help me with this..

Larry

Re: EB085 DSP input board

Posted: Thu May 21, 2015 10:01 am
by Benj
Hi Larry,
If I understand it correctly, then Initially should read .upper 00001010 and not (101001100) and .lower 10000000 and not (10000001) to account for the leading and trailing 4 zeros.
Yes you are right the values from the ADC will be 0's outside of the 16-bit data window. I think the values shown are simply examples to help show which parts of the data are collected rather then actual demonstration values from the ADC.

Re: EB085 DSP input board

Posted: Thu May 21, 2015 1:10 pm
by SHORTCIRCUIT
Hi Ben
Ok, good news. Then I do understand what is going on.

Thank you very much for your help.

Larry