USB Communication

A forum useful to discuss the details of the ScicosLab code generator.

Moderator: paolo.gai

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

USB Communication

Post by npascher » Mon Aug 31, 2009 2:29 pm

Hi all,

I try do establish a usb communication between the Flex Board Full and a PC running Scilab/Scicos.
I want the dsPIC to send a sine signal via usb to the PC - the PC should display the data, recieved from the ucb port, in a scope.

Therefor I flashed the FLEX_USB.cof into the PIC18 of the Flex Board. Then I updated the driver as mentioned in the following wiki:
http://www.evidence.eu.com/component/op ... temid,366/
this seems to be done correctly, because I can see the LibUSB-Win32-Device in the Device Manager.

As the next step I created the *.cos [img width=436]http://www.erika.tuxfamily.org/images/f ... _dspic.JPG[/img] with the sine signal and an additional LED so see if the dsPIC is working.
After the codegeneration by Scilab/Scicos I flashed the pic30.cof into the dsPIC33FJ256MC710 of the Full Flex Board.
(The additional LED is blinking)

Then I made another *cos which should recieve the data from the dspic via usb [img width=436]http://www.erika.tuxfamily.org/images/f ... _dspic.JPG[/img]

When I start the simulation in scicos, the LED on the board is blinking, but I can not see anythin in the scope and scilab crashes.


I hope you can understand my problem and help me

Thanks,

Nikolas
Attachments
usb_dspic.JPG
usb_dspic.JPG (20 KiB) Viewed 9401 times

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

Re:USB Communication

Post by npascher » Mon Aug 31, 2009 2:32 pm

the second picture should be
[img width=341]http://www.erika.tuxfamily.org/images/f ... usb_pc.JPG[/img]
Attachments
usb_pc.JPG
usb_pc.JPG (20 KiB) Viewed 9401 times

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

Re:USB Communication

Post by paolo.gai » Tue Sep 01, 2009 4:20 pm

Hi Nikolas!

I see that you solved the problem in another post.

Just as a note, we are going to change the USB support part PC-side with the next version, which should (hopefully) be released in the monbth of March. This should avoid the problems with the USB crashes on Scilab.

Ciao,

PJ

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

Re:USB Communication

Post by paolo.gai » Mon Oct 12, 2009 4:16 pm

Dear Nikolas...

we just released the scicos pack v8, which includes a new revised version of the USB communication on the PC side, which avoids the blockings previously experienced with Scicos... If you have tme please try it!

Ciao,

Paolo

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

Re:USB Communication

Post by npascher » Tue Oct 13, 2009 8:59 am

Hey Paolo,

thanks for the new release.

If I try to run the codegeneration I recieve the following error message:
Step 3: Compiling the application

The application is now compiled
--------------------------------------------------------
cygpath: cannot create short name of c:\\Programmi\\Microchip\\MPLAB ASM30 Suite
Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... NAME...
cygpath [-c HANDLE]
cygpath [-ADHPSW]
Convert Unix and Windows format paths, or output system path information
I guess, I have to change the path do my MPLAB folder.
Because of the update to EE1.5 I can\'t find the file where to change it. In the older version, the file was located (as mentioned in the manual) in "c:/evidence/evidence
/bin/rtd_config.properties".
Is there any compareable file where I need to change the path to my MPLAB?


CIAO,

Niko

blackant
Newbie
Posts: 6
Joined: Sun May 31, 2009 8:50 pm

Re:USB Communication

Post by blackant » Tue Oct 13, 2009 2:16 pm

Hi there,

the file to be changed has moved into the Evidence directory inside Eclipse;
in my case (and I think the default installation\'s case):

C:\\\\Evidence\\\\Evidence\\\\eclipse\\\\Evidence\\\\common_oil.pref

The syntax should be the same (as the old file).

Hope this helps.


blackant

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

Re:USB Communication

Post by npascher » Tue Oct 13, 2009 2:25 pm

Hey,

thanks for your answer. Sadly I don\'t have the file \"common_oil.pref\".

Do I have to change any configurations in Eclipse/EE?

Regards,

Niko

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

Re:USB Communication

Post by paolo.gai » Tue Oct 13, 2009 4:09 pm

You are right, we forgot to package the file inside the distribution.

Let me check for this and we\'ll post it as soon as possible...

PJ

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

Re:USB Communication

Post by paolo.gai » Tue Oct 13, 2009 5:33 pm

Ok. Solved. The missing file is now uploaded.

Please follow the updated instructions on the page

http://www.evidence.eu.com/content/view/293/382/

...I just tried them on my Vista machine and they works fine...

Let me know if something still does not work...

PJ

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

Re:USB Communication

Post by npascher » Wed Oct 14, 2009 10:33 am

Hey,

thanks for your answers. The Codegeneration works fine.
I just compiled the demoboard_example_flexside.cos
and flashed the generated pic30.cof onto the dspic.
Then I started the demoboard_example_pcside.cos and scilab crashed.
I think, because I did not execute the app_flex_scicos.exe.

I can not compile the executeable. I\'am not familiar with makefiles :(
The folowing error message appears:
C:/TEMP/contrib/flex_usb2udp_gateway>nmake all

Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

makefile(13) : fatal error U1036: syntax error : too many names to left of \'=\'
Stop.

What can I do?

Regards,

Niko

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

Re:USB Communication

Post by paolo.gai » Wed Oct 14, 2009 10:59 am

Dear Niko,

there should be a readme.txt file on the folder explaining what to do...

basically you need to:

- install the libusb from the Cygwin setup program (http://www.cygwin.com)

- open a cygwin console, go into the directory, and type \"make\" (the Cygwin\'s make, not Microsoft \"nmake\")

- then, run the program from the cygwin console (it should work also from the CMD prompt)

bye

PJ

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

Re:USB Communication

Post by npascher » Wed Oct 14, 2009 11:17 am

Ok thanks, I\'ll try it...
I did as you told me...

Everything seems to be working.

I will work the next days with it. If I get in trouble or see any mistakes I will let you know...


Thank you,

Niko

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

Re:USB Communication

Post by npascher » Wed Oct 14, 2009 2:56 pm

I can not establish a working usb connection I did the following:
- Flash the firmware from the package scicos_pack_v8 into the pic18, if I connect the port via usb to the pc, I find the board as LibUSB-Win32 Device in the device manager. This seems to be ok.

- Compile the demoboard_example_flexside.cos out of the scicos_pack_v8 an flash it into the dspic.
- run the app_flex_scicos in a cmd. I get this output:
*************************************************
Enstablish Flex-Scicos Communication
\'.\' Received from flex and sent to scicos
\'*\' Received from scicos and sent to flex
*************************************************

- flex_usbscicos_init() : OK.

Start Application ...
.*.*.*.*.*.*.*.*.*.*.*.*

seems to be working, too.

- Open demoboard_example_pcside.cos and click on simluate -> run.
- On the scope in scicos, i just see constants. In the display of the daughterboard there is 0.000 depicted.
If it was working correctly, I think the LED on my Demoboard should flash, because of the sine, transmitted from Scicos. But the Led is not flashing.

It seems to me, that there is anything incorrect. At the moment I have no idea what it might be...


I modified the schema for the dspic:
A sine is generated by the dspic (connected to the led) and send by usb to the pc.
The led is flashing, but in the scope in scicos, I still have smooth lines (constant 0).

I tried to switch off my firewall, because I thought the port 50000 might be blocked...


Does anybody can help me?

Regards,

Niko

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

Re:USB Communication

Post by paolo.gai » Thu Oct 15, 2009 3:56 pm

Dear Niko,

Dario and Francesco worked today to understand what was the problem was... and the result is...

...as it always happens, we put the wrong COFF in the Scicos Pack V8 :-(

Sorry for that...

I just updated the Scicos Pack (naming it Scicos Pack 8.1) to contain the correct COFF file we typically use for

Please use THAT coff file :-)

Ciao,

Paolo

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

Re:USB Communication

Post by npascher » Mon Oct 19, 2009 8:19 am

Dear all,

thanks. With the new *.cof it is working properly.


Regards,

Niko

Locked