MSComm or API ?

Boštjan
01-06-2001, 02:18 PM
HI!
I'd like to write a program in VB to communicate with serial PIC programer which uses:
- RTS line as a CLOCK signal
- DTR line as Output Data
- CTS line as Input Data
- TxD line as Vcc for PIC

Clock and Data signals are cca. 0.06 ms lentgh or even less.
My question is: Is it posibble to do this with a MSComm1 control or must I use something else like calling API, or even a routine in C ?
If is posibble, can enybody help me ?

Thx.
Boštjan

BillSoo
01-06-2001, 02:46 PM
60 microseconds?! That's pretty fast! I'm not sure if you can even measure a time interval that small. You can try the timegettime API call though. Or maybe use a custom for-next loop.

As for communication, I suspect you may have to go low-level and write directly to the port latches. To do this, you need to understand low level hardware addresses and you need a control or DLL that will allow you to write to ports. I used inpout.dll for a project I did one time. You might find it out there on the web. It should be free. One place to look is www.cgvb.com and check their links.


"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

Boštjan
01-06-2001, 04:00 PM
I know it's fast, that's why I'm asking if I can do that with MSComm1 control directly or not ?

P.s.: You can measure signals of 0.06ms with oscilloscope!

Derek Stone
01-07-2001, 06:12 AM
You couldn't use MSComm to do this, in my opinion.
Its just not built for that kind of work.
Take BillSoo's suggestion and use it.

Good Luck
-cl

<a href="http://vb.wsoftware.net" target="_new">http://vb.wsoftware.net</a>

BillSoo
01-07-2001, 02:46 PM
Bostjan wrote:

<P.s.: You can measure signals of 0.06ms with oscilloscope!>

Yes I know, I've used oscilliscopes before to check communications on a serial port before. My point was that it may be difficult to get the computer to send a character at such precise intervals. Certainly the timer control is useless and I'm not sure if any API call can work. The most I've asked timegettime to do is +/- 1 ms.



"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum