EB085 DSP input board

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
randomrichard
Posts: 41
Joined: Thu Oct 16, 2008 11:01 am
Has thanked: 21 times
Been thanked: 7 times
Contact:

EB085 DSP input board

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: EB085 DSP input board

Post by Benj »

Hello,

Here are the files mentioned in the datasheet. Let me know if you have any problems.
Attachments
DSP_Output.hex
(1.94 KiB) Downloaded 472 times
DSP_Output.fcf
(19.49 KiB) Downloaded 545 times
DSP_Input.hex
(1.63 KiB) Downloaded 472 times
DSP_Input.fcf
(14.85 KiB) Downloaded 593 times

randomrichard
Posts: 41
Joined: Thu Oct 16, 2008 11:01 am
Has thanked: 21 times
Been thanked: 7 times
Contact:

Re: EB085 DSP input board

Post 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

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: EB085 DSP input board

Post 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.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

SHORTCIRCUIT
Posts: 155
Joined: Thu Feb 10, 2011 4:39 am
Location: Las Vegas, Nevada USA
Has thanked: 40 times
Been thanked: 19 times
Contact:

Re: EB085 DSP input board

Post 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

SHORTCIRCUIT
Posts: 155
Joined: Thu Feb 10, 2011 4:39 am
Location: Las Vegas, Nevada USA
Has thanked: 40 times
Been thanked: 19 times
Contact:

Re: EB085 DSP input board

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: EB085 DSP input board

Post 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.

SHORTCIRCUIT
Posts: 155
Joined: Thu Feb 10, 2011 4:39 am
Location: Las Vegas, Nevada USA
Has thanked: 40 times
Been thanked: 19 times
Contact:

Re: EB085 DSP input board

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: EB085 DSP input board

Post 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.

SHORTCIRCUIT
Posts: 155
Joined: Thu Feb 10, 2011 4:39 am
Location: Las Vegas, Nevada USA
Has thanked: 40 times
Been thanked: 19 times
Contact:

Re: EB085 DSP input board

Post by SHORTCIRCUIT »

Hi Ben
Ok, good news. Then I do understand what is going on.

Thank you very much for your help.

Larry

Post Reply