USB-Communication 2

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 2

Post by npascher » Wed Oct 28, 2009 11:58 am

Hi,

I\'m able to establish a working USB communication. But the communication runs realy \"slowly\".


The clock is set to 1ms. On the PC I set the clock to 1ms as well, but the data seem not to be recieved every 1ms.
A simulation gives the expected values. The period an the impulse width of the square are set to 0.002 and 0.001.
If I display the recieved data in a scope, it seems, that every ~200ms a change in the recieved data is possible.

What is the shortest time I can send data through USB?
Where can I change this value? I guess it is in the firmaware on the PIC18?[img width=150][/img]



Thanks for help,

Niko [img width=468]http://www.erika.tuxfamily.org/images/f ... enannt.JPG[/img]
Attachments
Unbenannt.JPG
Unbenannt.JPG (20 KiB) Viewed 3193 times

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

Re:USB-Communication 2

Post by npascher » Wed Oct 28, 2009 12:02 pm

the Dac out is added because of compilation probs, like mentioned in another post.

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

Re:USB-Communication 2

Post by npascher » Wed Oct 28, 2009 1:39 pm

the Dac out is added because of compilation probs, like mentioned in another post.

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

Re:USB-Communication 2

Post by paolo.gai » Wed Oct 28, 2009 6:12 pm

There are a few places to change to make a faster communciation:

dsPIC Side:
- the code which is now sending the USB data only sends 15 floats at a time. If I remember well the latest version made by Christian removed the buffering.

PIC18 side:
- the PIC18 firmware receives from SPI and sends it to the USB

PC side:
- the application we made use the libUSB from Cygwin.
- we noted that the USB transmission speed depends a lot on the PC side. The best transmission speed were obtained by using an \"always active (without sleep)\" version of the program. otherwise you get a few samples only.

Another option could be to use other buses to implement the communication, like CAN/serial/SPI/I2C... but it is more difficult to get the information on the PC side...

PJ

Locked