Code generator for Flex. Really good but...

Forum related to the FLEX boards

Moderator: paolo.gai

desmomito
Newbie
Posts: 27
Joined: Wed Mar 05, 2008 4:03 pm

Code generator for Flex. Really good but...

Post by desmomito » Wed Jun 11, 2008 12:13 pm

Hi,
I\'m starting to use the code generator for Flex Full board and I\'m really interested in that. I\'d like to design a digital control system all with Scicos code generator. I\'ve read the documentation in order to understand how to use the dsPIC inputs and outputs. I\'ve seen for example that the PWM is fixed at 1ms. I\'d like to customize my application in order to have the specifications I want to achieve. For example I\'d like to have a 16kHz PWM, different use of the ADC, etc..How can I manage to do that ? Should I modify the Scicos block ? Is there any docs that explain those points ?


Thanks in advance,
Pasquale.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:Code generator for Flex. Really good but...

Post by paolo.gai » Wed Jun 11, 2008 2:36 pm

Hi Pasquale...

You need to look inside the files which implement each scicos block, and modify them!

You can find them under the /ee/contrib/scicos .

The demo application which is generated is inside /examples/pic30/pic30_scicos

bye

PJ

desmomito
Newbie
Posts: 27
Joined: Wed Mar 05, 2008 4:03 pm

Re:Code generator for Flex. Really good but...

Post by desmomito » Wed Jun 11, 2008 11:00 pm

Thank you,
but what I want to know is how to build my own library. I know I can start modifying that files but I\'d like to create new ones starting from them. Do you have more docs on how to do that ? I know it\'s not really easy but I\'m really interested in do that.


Thank you,
Pasquale.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:Code generator for Flex. Really good but...

Post by paolo.gai » Thu Jun 12, 2008 8:10 am

There is a post in the early days of this forum which documents how to manage and create new Scicos blocks...

http://www.evidence.eu.com/component/op ... 6/catid,3/

It\'s probably the case to insert it into the manuals

You need to:

- generate new blocks using the block generator from Roberto. You can find it in Roberto Bucher\'s home page at http://web.dti.supsi.ch/~bucher/

- create your own Scicos palette (described before in the forum)

- create your scicos library into contrib (described before in the forum)

bye

PJ

desmomito
Newbie
Posts: 27
Joined: Wed Mar 05, 2008 4:03 pm

Re:Code generator for Flex. Really good but...

Post by desmomito » Thu Jun 12, 2008 2:21 pm

Thank you.
Now I\'m trying to buil the first application using the code generator. What I\'ve done is to follow the explanation written in \"Scilab/Scicos code generator for Flex\" and I\'ve built the example (Sinus+Led). I moved on MPLAD, I\'ve imported the \"pic30.elf\". Than I programmed the Flex using MPLAB \"Program Target Device\". Than I removed the MPLAD ICD2, I switched off the Flex and than I swtiched on again. I can see that the LED goes on and off but just 4 or 5 times and than nothing happen. Also if I switch off and on again the Flex nothing happen. Where am I wrong ?


Thank you,
Pasquale.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:Code generator for Flex. Really good but...

Post by paolo.gai » Thu Jun 12, 2008 5:44 pm

hmmm... quite strange.

Are you able to correctly program the board with the other examples we provide under RT-Druid? (e.g., the simple periodic task example)?

PJ

desmomito
Newbie
Posts: 27
Joined: Wed Mar 05, 2008 4:03 pm

Re:Code generator for Flex. Really good but...

Post by desmomito » Thu Jun 12, 2008 7:18 pm

Are you able to correctly program the board with the other examples we provide under RT-Druid?

Where are those examples ?

I\'ve used that because I think is the only one which leave me a feedback if something is working (because of the sys-led). I don\'t have any daughter board for now. I\'ve used the MPLAB v8.00 and C30 v2.05 Student Version. I don\'t have any errors in programming the board, everything is ok. When I switch on sometimes work sometimes doesn\'t. Maybe I\'m missing something but I\'ve correcly followed the procedure. Maybe I\'m wrong using the MPLAB, but I really don\'t know.

Thank you,
Pasquale.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:Code generator for Flex. Really good but...

Post by paolo.gai » Fri Jun 13, 2008 7:40 am

Let\'s try to narrow the possibilities.

Try open RT-Druid, create a project using the template \"simple periodic task\", which basically blinks the system led.

Does that application runs on your hardware? that one should have no problem.

bye

PJ

desmomito
Newbie
Posts: 27
Joined: Wed Mar 05, 2008 4:03 pm

Re:Code generator for Flex. Really good but...

Post by desmomito » Fri Jun 13, 2008 10:38 am

Hi,
I\'ve just tried and it works. I have problem with generating code using Scicos. This morning the generation process stop in itself and freeze my laptop. I really don\'t know why. What can I do ?
I have one more question. I used the \"simple periodic task\" in a \"Programmer mode\"because I get an error using \"Debugger mode\" using MPLAB IDE. How can I solve that ?


Thank you,
Pasquale.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:Code generator for Flex. Really good but...

Post by paolo.gai » Mon Jun 16, 2008 8:22 am

Dear Pasquale...

- did the compilation finished correctly or stopped in some point? in which point did it freeze?... There is nothing strange in the software we distribute that can freeze your laptop...

- About the debugger/Programming mode: This is quite strange; probably the jumper settings are not set correctly?

Btw... I know you are from Pisa... Are you coming to the OSEK training course next week? that could be a place to solve live your problems...

bye

PJ

desmomito
Newbie
Posts: 27
Joined: Wed Mar 05, 2008 4:03 pm

Re:Code generator for Flex. Really good but...

Post by desmomito » Tue Jun 17, 2008 2:10 pm

did the compilation finished correctly or stopped in some point? in which point did it freeze?... There is nothing strange in the software we distribute that can freeze your laptop...

I\'ve tried again it doesn\'t freeze but at some point it goes really slow in compilation. I\'ll send you where exactly it begin to be slow. For this reasons my laptop freeze because I cannot close the \"cmd\" window etc..

About the debugger/Programming mode: This is quite strange; probably the jumper settings are not set correctly?

I\'ve followed the jumper setting written in Flex Reference Manual. Should I check some jumpers ?

I\'ve opened MPLAB, I\'ve imported the .elf and than I\'ve pushed on debug etc.. Is this the procedure ?

Btw... I know you are from Pisa... Are you coming to the OSEK training course next week? that could be a place to solve live your problems...

I don\'t know. I\'ve seen that there are just a few places. If there are still some free, maybe I can think about that.

Thank you,
Pasquale.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:Code generator for Flex. Really good but...

Post by paolo.gai » Thu Jun 19, 2008 6:49 pm

If not... you can try to just pass by on Tuesday... there are the lab experiments going on... and maybe someone will be able to spare some time to solve the issue...

PJ

npascher
Newbie
Posts: 23
Joined: Mon Aug 31, 2009 12:25 pm

Re:Code generator for Flex. Really good but...

Post by npascher » Wed Sep 16, 2009 2:19 pm

Hey all,

I\'ve got another problem. This time I\'d like to change the period of the "system activation clock". The lowest value I can enter is 1 ms.

A couple of month ago Paolo wrote:
Re:Code generator for Flex. Really good but... 1 Year, 3 Months ago Karma: 5
Hi Pasquale...

You need to look inside the files which implement each scicos block, and modify them!

You can find them under the /ee/contrib/scicos .

The demo application which is generated is inside /examples/pic30/pic30_scicos

bye

PJ
When I take a look in the mentioned folder, (/ee/contrib/scicos) unfortunatelly I can\'t find any *.c file, even in the subfolders, in which I would suppose the clock time.

Can anyone please tell me, where I can find the file, where I can change the minimum value of the activation clock?


Kind regards,

Niko

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re:Code generator for Flex. Really good but...

Post by paolo.gai » Fri Sep 18, 2009 12:13 pm

Dear Niko,

sorry for the delay in the reply, I 2wa out of town.

You must find the file named dspic/main.c in your installation. The file is present in the examples directories, that is the directory where RT-Druid takes the files to generate a nw project from a template.

The files are located:
- in ERIKA 1.4.3, in c:/evidence/evidence/examples/,
- in ERIKA 1.5.0 {alpha|beta1|...}, The ERIKA code is now packaged as an eclipse plugin to allow an easier update and extension of the examples. For that reason, take a look at c:/Evidence/Evidence/eclipse/plugins/ . then look at the examples plugin for your architecture, then inside the plugin you\'ll find teh examples directory.

Once found the examples directory, go into examples/pic30/pic30_scicos/dspic_main.c

inside the file, you have to change the period of the timer interrupt, as well as the line

dspic_time = (int) (1000*scicos_time);

Ciao,

PJ

npascher
Newbie
Posts: 23
Joined: Mon Aug 31, 2009 12:25 pm

Re:Code generator for Flex. Really good but...

Post by npascher » Tue Oct 06, 2009 12:00 pm

Hey Paolo,

thanks for your answer.

You wrote, I have to change the period of the timer interrupt, where do I have to change it? I can not find it in the dspic_main.c file...


Ciao,

Niko

Locked