Zsola wrote:Is there possible to make such one-way communication (from PIC to PC) at certain, unknown delayed times when you can receive data? Or we can use only polling?
One example to make it clear: I want to send data only after a button pushed on PIC. I don't want to "ask" the PIC wheter the button pushed or not. That consume USB bandwith and resources (don't laugh). The doing on PIC are clear, I want to optimize the software on PC.
On a couple of Delphi components - thats don't work with the PICs as you mentioned on your webpage - there is an "OnDataAvailable" or "OnDataReceived" event, so it tells in the SW I have to read or not.
I tried CiaComport, nrComm and ZylCom port components, neither worked. What do you mean on "such behavior", what kind of settings we shall make (DTR, Xon-off, etc.)?
Hi, the only thing I know is that on the PC side the communication has to be done with
ReadFile and
WriteFile calls to an open com port when using the usbcom driver (see the PC software deivered with the CDC library). I do not know what type of calls the software you mention use.
Also "Hyperterminal" does not work.
With the PC software I delivered is a delphi file "Wincon.pas", wherein you can find all SW to open/close/read/write a com port.
About usb "polling": the PC itself does always polling to all the usb devices. No device can signal to the PC it has something unless it is polled by the PC. Of course, in high level software constructions like with "OnDataAvailable" can be present, but nevertheless, the PC always polls the USB devices on "usb level".
p.s. All "line" settings of a com port like this (a virtual one) have no meaning (at least not with the usbcom driver): DTR, CTS, Xon, Xof, baudrate, etc...). The only things that are important are the "ComTimeouts" (defined in Wincom.pas) for the (virtual) comport.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)