View previous topic :: View next topic |
Author |
Message |
georpo
Joined: 18 Nov 2008 Posts: 281 Location: Athens, Greece.
|
ex_usb_serial |
Posted: Sun Oct 18, 2009 8:59 am |
|
|
Hello forum!
I used the usb to serial example with success but here is a question.
How can I use handshaking to make the pc wait between transmisions?
There is no CTS here like RS232...
Thanks |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sun Oct 18, 2009 9:46 am |
|
|
CTS isn't needed. The PC stopps sending data, if the TX endpoint buffer isn't emptied at the USB device side. |
|
|
georpo
Joined: 18 Nov 2008 Posts: 281 Location: Athens, Greece.
|
|
Posted: Sun Oct 18, 2009 9:50 am |
|
|
This is great news!
So, If I do not "usb_cdc_getc()" then the pc waits till I do. Right? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sun Oct 18, 2009 11:49 am |
|
|
Yes. When the USB device and PC commdriver buffers are full, WriteFile() returns with zero bytes written. It's important not to ignore the WriteFile() result. |
|
|
georpo
Joined: 18 Nov 2008 Posts: 281 Location: Athens, Greece.
|
|
Posted: Sun Oct 18, 2009 12:25 pm |
|
|
I am not sure what WriteFile() is. I am using visual basic to send data to the pic through the visual cdc port.
The command is "comport.output=data" I do not think that this returns anything. Any help appreciated!
Something else, how do I know that I am running at full speed? The example is supposed to use internal pullup resistors but I cannot find this anywhere in the code. I tried to send a 100KB file and it needs 100 seconds to finish! |
|
|
|