Page 1 of 2

Flowcode for dsPIC - DSP Support Poll

Posted: Tue Apr 17, 2012 4:23 pm
by Benj
Hello,

Version 5 of Flowcode for dsPICs is currently under development and we are looking into adding certain DSP libraries into Flowcode in the form of DSP components.

Has anyone got any requests for DSP functionality?
If you can suggest a process and demonstrate how you would use it on an application or as a learning resource then what would it be and what hardware would it require?

We currently have an idea of what's possible and what we would like to provide but it's always good to get everyone's opinion before starting down a particular path.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Apr 18, 2012 10:13 am
by Benj
Ok no replies so far so I will give an example of what is possible.

Vector Operations - Path Finding / Games
Matrix Operations - Forward & Reverse Kinematics / Games / Automatic Mapping
Filtering Operations - FIR / IIR / Low Pass / High Pass / Band Pass
Transform Operations - FFT http://en.wikipedia.org/wiki/Fft
Window Operations - http://en.wikipedia.org/wiki/Window_function

This is by no means an exhaustive list so if you have suggestions for DSP then please let me know.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Thu Apr 19, 2012 1:29 pm
by dazz
Ok i'll bite :D
although i dont use dspics at the moment i will in the future, will remappable pins be a function of flowcode

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Thu Apr 19, 2012 4:39 pm
by Benj
Hello,

Good question. At the moment I have kinda swept this under the carpet and put in hard coded remapped pins as part of the code abstraction layer.

We may be able to do something different regarding this. Eg we could have the remapping specified as part of the FCD file. This way you could clone the FCD file and modify the remap and then you can choose the different target in the project options target list for the different hardcoded remaps.

Of course allowing remaps to take place via Flowcode's interface would be much better so I will see what can be done here. So far I have not really been able to think of a way of doing this without having to rewrite part of the Flowcode executable code.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Fri Apr 20, 2012 8:29 am
by saschech@gmx.de
Hello Benj

Have V5 vor ds-pic a support for the new "dsPIC33EP256MU814" "PIC24EPXXX(GP/GU)810/814 "(all xxE types up to 70mips)?

Regards Wolfgang

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Fri Apr 20, 2012 12:57 pm
by petesmart
Ok... I will bite as well...

I would like to have tools to implement kalman filters - Multi axis a must 3DOF - 5DOF.. This is for the filtering of gyros and accelerometers, noise management etc..

Ideally the ability to deal with matrices would be very useful..As you mentioned..

Ben, you may remember that I sent you some info via a PM.. I can dig it out and post again if that helps..

Kalman filters are brilliant for robots and autonomous control..

Thanks for the question..

All the best

Pete

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Apr 25, 2012 8:21 pm
by BChappy
Hello Ben,

I would be interested in;
Filtering Operations: Lo. Hi Pass filters etc... particularly if the audio DAC features were available as a component macro to full resolution.
Matrix operations: Kinematics for robotics apps. etc.
petesmart wrote: I would like to have tools to implement kalman filters - Multi axis a must 3DOF - 5DOF.. This is for the filtering of gyros and accelerometers, noise management etc...
Kalman Filters sound interesting! :)

Thanks for asking

Brian

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Sun Apr 29, 2012 2:49 am
by beambase
Hello
good to hear that a Version 5 of dsPIC is on it''s way.
Something I would like to see is that the dsPIC is brought up to the same standard as the 8 bit version in funcionality. It would be good if better support for the 30F601_A series could be supported. It seeams as there are still problems in getting components that uses internal registers in the chip are not working very well sometimes. So far I had problems with the EEPROM and the CAN components.
Also it would be good to have full and tested support for the latest E-Block moduls like the EB076 since that kkind of E-Blocks could realy benefit from the speed and the size of the memory in the 16-bit PICS.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Mon May 07, 2012 1:13 pm
by beambase
Hello
an usefull addition to the current CAN component would be a macro that changed the speed of the CAN bus as you can change the baudrate in the upgraded RS232 component in FC 5.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Fri May 25, 2012 10:22 pm
by Mark
A Fourier transform routine would be very useful,
Also matrix and matrix manipulation features would be very useful.

Also can it be made as a 'bolt on' to Flowcode 5 rather than a seperate product. Buying two
full packages (or at least updating them) is onerous and they are also out of sync. I have given up
on dsPIC Fcode as it is frustrating when faced with not being able to use Flowcode 5 options,
even for example documentation options etc. etc.

Thanks,

Mark

ps a Kalman filter feature would certainly be of interest.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Jul 18, 2012 6:57 pm
by Benj
Hello Mark,

Thanks for the input.

We have now moved on with this a little and have a better idea of what is going to happen.
A Fourier transform routine would be very useful,
This is already in the mix as a FFT and also an inverse FFT to convert back to the time domain.
Also matrix and matrix manipulation features would be very useful.
Agreed, I will think up a way to get this in.
Also can it be made as a 'bolt on' to Flowcode 5 rather than a seperate product. Buying two
full packages (or at least updating them) is onerous and they are also out of sync.
Yes our current intention is to add this to v5 for the dsPIC product and maybe to the other v5 products too. If not then it should be part of v6.
I have given up on dsPIC Fcode as it is frustrating when faced with not being able to use Flowcode 5 options, even for example documentation options etc. etc.
We have a v5 beta for dsPIC available now for download, there are still lots of problems with the more advanced components so not recommended for most users but if interested then contact DavidA for details. Also if you sign up for this then you should also get access to the DSP document explaining what we are planning.
ps a Kalman filter feature would certainly be of interest.
I will try and work out a way to do this using the DSP bits and pieces, Kalman filters are certainly a popular topic at the moment.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Jul 18, 2012 10:05 pm
by randomrichard
Benj
This is off-topic but may have general relevance. I have noticed that the PIC chip list for Flowcode 5 includes advanced 64/80 pin TQFP chips like the 18F87K22. What board supports their programming? Could I also use that board to access the two similar 80 pin TQFP chips Microchip make that have a two channel 16/24bit ADC - the 18F87J22 and 18F86J22? If not could I request that your next upgrade of F5 includes these two chips. There are a lot of non-audio tasks that require a 16/24bit analogue range, which is not currently catered for.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Mon Sep 03, 2012 10:14 pm
by beambase
Hello
are there any news on the release of the dsPIC Version 5? Any date set for a release yet?

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Tue Sep 04, 2012 10:57 am
by Benj
Hello Richard,

Sorry for the delay in replying to you. I will try and get these devices into the next update release but it really depends on if they are supported by the BoostC compiler by then. BoostC are normally quite quick at supporting new devices so I don't see this being an issue.

Hello Beambase,

We are due to begin beta testing soon and I think the current plan is to release it in around a month near the start of October. We have added a lot of functionality to it and I am currently going through it with a fine tooth comb to make sure we eliminate as many bugs as possible.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Oct 03, 2012 1:29 pm
by benp
Hello,

I have the flowcode dspicV5.
I am looking for the FFT functions but I can't find it.
Is it still under developpment or ready to use hiden somewhere I can't find.
If you have a beta version. Can I test it.

Thank you

Regards

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Oct 03, 2012 1:37 pm
by Benj
Hello,

We decided to delay the DSP components until Feb next year so we could make it better and get more functionality in there. I will let you know when we have something in the form of a Beta that can be played with.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Oct 03, 2012 1:46 pm
by benp
Thank you
Do you have some links to documents on how to perform a FFT with dsPIC.
My colleague need it quickly so he will try to do it in C or manual calculation.
You should have some news from him here...

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Oct 03, 2012 2:14 pm
by yannr
thank you benp,

we really need this FFT component. We are planing to use it to detect biological signals, in
human body. We hope to control a car with this component only with mind.
We are doing this with an hospital near lyon (france) and if you had a beta version it would be
quite usefull to try it.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Oct 03, 2012 2:24 pm
by Benj
I have some FFT code which I can pass to you quickly but im now out of the office until tomorrow.

Is this ok or should I ask a collegue to dig out the file for me so you can have example C code today?

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Oct 03, 2012 2:28 pm
by yannr
it will be really nice to have a FFT code, I think I can wait untill tommrow
thanks.

:D

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Thu Oct 04, 2012 9:18 pm
by yannr
don't forget me. :D
yann

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Fri Oct 05, 2012 9:40 am
by Benj
Hello,

This is the FFT function I have so far. I've had it partially working but it needs a few minor tweaks etc to get it stable.

Code: Select all

void DSP_FFT(MX_STRING Real, MX_UINT8 MSZ_Real, MX_STRING Imaginary, MX_UINT8 MSZ_Imaginary)
{
	MX_SINT32 mr = 0, i, j, l, k, c, istep, shift;
	MX_SINT16 qr, qi, tr, ti, wr, wi, b, m;

	m = FFT_SAMPLE_POWER;

	// decimation in time - re-order data
	for (m = 1; m <= FFT_SAMPLE_CNTM1; ++m)
	{
		l = FFT_SAMPLE_COUNT;
		do
		{
			l >>= 1;
		} while (mr+l > FFT_SAMPLE_CNTM1);

		mr = (mr & (l-1)) + l;
		if (mr <= m) continue;

		tr = Real[m];
		Real[m] = Real[mr];
		Real[mr] = tr;
		ti = Imaginary[m];
		Imaginary[m] = Imaginary[mr];
		Imaginary[mr] = ti;
	}

	l = 1;
	k = LOG2_N_WAVE-1;

	while (l < n)
	{
		istep = l << 1;
		for (m=0; m<l; ++m)
		{
			j = m << k;
			// 0 <= j < N_WAVE/2
			wr =  Sinewave[j + (FFT_N_WAVE / 4)];
			wi = -Sinewave[j];

			wr >>= 1;
			wi >>= 1;

			for (i=m; i<n; i+=istep)
			{
				j = i + l;

				// Here I unrolled the multiplications to prevent overhead
				// for procedural calls (we don't need to be clever about
				// the actual multiplications since the pic has an onboard
				// 8x8 multiplier in the ALU):

				// tr = FIX_MPY(wr,fr[j]) - FIX_MPY(wi,fi[j]);
				c = ((long int)wr * (long int)Real[j]);
				c = c >> 14;
				b = c & 0x01;
				tr = (c >> 1) + b;

				c = ((long int)wi * (long int)Imaginary[j]);
				c = c >> 14;
				b = c & 0x01;
				tr = tr - ((c >> 1) + b);

				// ti = FIX_MPY(wr,fi[j]) + FIX_MPY(wi,fr[j]);
				c = ((long int)wr * (long int)Imaginary[j]);
				c = c >> 14;
				b = c & 0x01;
				ti = (c >> 1) + b;

				c = ((long int)wi * (long int)Real[j]);
				c = c >> 14;
				b = c & 0x01;
				ti = ti + ((c >> 1) + b);

				qr = Real[i];
				qi = Imaginary[i];
				qr >>= 1;
				qi >>= 1;

				Real[j] = qr - tr;
				Imaginary[j] = qi - ti;
				Real[i] = qr + tr;
				Imaginary[i] = qi + ti;
			}
		}

		--k;
		l = istep;
	}
}

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Mon Oct 08, 2012 4:48 pm
by benp
Hello Benj,

Maybe I am wrong but the C30 compiler is supposed to have the FFT library included.
See here:
http://www.microchip.com/stellent/idcpl ... e=en023598
Why don't you use this one in flowcode?
I didn't find more doc but it is supposed to be in:
C:\Program Files\Microchip\MPLAB C30\docs\dsp_lib
If you have the C30 installed in MPLAB (I don't)
Can someone find more info about this?

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Tue Oct 09, 2012 9:42 am
by Benj
Hello,

The library included as part of the C30 compiler is officially for benchmarking chips only and appears from my personal testing plus the comments of other users to be full of bugs. Therefore we have developed our own DSP routines which are not reliant on the Microchip library. The upside to this is that the new DSP components should be compatible with all Flowcode variants not just the 16-bit PICs.

Re: Flowcode for dsPIC - DSP Support Poll

Posted: Wed Dec 05, 2012 9:38 pm
by yannr
HI Benj,

For my project, I will use a Discret Fourier Transformation.
I've made an excel File to make Calculations in order to test what I have with flowcode.
I hope, it can help you to try quick Calculations.
the FFT is a DFT and the cooley Tukey (FFT) is also a DFT.

Yann