Re: Can you help me to explain a question about serial port and resolve the problem.
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Fri, 17 Feb 2006 19:30:28 -0800
You shoud not change settings of the serial port while you transmit data or
expect received data. At 2400 bps, it takes 4 ms just to send one byte, only
then you should change your settings.
Since you have to switch parity for the received byte, I'm not sure this
will reliably work at all, because there is no guarantee whatsoever that
you'll be able to do it in time, before the device will start sending data.
Your best bet is to send data from COM1 and receive it through COM2,
providing the special wiring for your setup.
"youhow" <youhow@xxxxxxx> wrote in message
news:1140228843.838654.105140@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thanks Pavel A.
I'm not good at English, hope I have explained my question clearly.
In chips side, they are identified by CHIP NUMBER and MARKPARITY
command sent from computer, the designated chip returns after 10 ms
without receiving followed CMD and SPACEPARITY command from computer.
I have to insert Sleep(n ms) between II and III, or the program can not
receive any bytes from the chip microprocessor. Although I have
inserted Sleep(n) between II and III, the program occasionally fails to
communicate with chips.
I have tried to use IOCTL_SERIAL_GET_DTRRTS to capture the change of
RTS status to detect whether serial port hardware buffer was empty, but
the communication still failed without insert Sleep(n).
I want to know the reason why I should insert Sleep(n), is it correct?
and How to make the communication 100% successful.
Thanks again.
.
- Follow-Ups:
- References:
- Prev by Date: Re: how to track irp??
- Next by Date: Re: How to handle INT3?
- Previous by thread: Re: Can you help me to explain a question about serial port and resolve the problem.
- Next by thread: Re: Can you help me to explain a question about serial port and resolve the problem.
- Index(es):
Relevant Pages
|