Re: Serial communication problems
- From: voidcoder <voidcoder@xxxxxxxxx>
- Date: Tue, 17 Oct 2006 23:33:43 +0200
>>> - Are you sure COM1 is exactly what you need, why
>>> not COM2, for example?
>>
>> I tried that too.
You don't need to guess, you need to know exactly
how much serial ports are on your board, which of
them have an active driver instance running and
what COMx prefixes they are mapped to.
>>> - Does the serial cable that you are using contain
>>> all the required signals, including flow control
>>> signals?
>>
>> There's no need of flow control signals in my app.
Why flow control is enabled then?
>>PortDCB.fDtrControl = DTR_CONTROL_ENABLE;
>>PortDCB.fRtsControl = RTS_CONTROL_ENABLE;
Marco Malentacchi wrote:
voidcoder ha scritto:.Some leading questions:I verified in two ways: first a led in the board which should turn on when serial signals are processed (and it works for other serial sources).
- How do you verify that it doesn't send anything?
- Are you sure COM1 is exactly what you need, why
not COM2, for example?
I tried that too.
- You have enabled h/w flow control, is the serial
connection on the other end of the cable configured
accordingly?
Yes, because I tried to send signals with a PC utility to the device and it receives them.
- Does the serial cable that you are using contain
all the required signals, including flow control
signals?
There's no need of flow control signals in my app.
- You are writing a UNICODE string (2 bytes per char)
but specifying number of chars instead of number
of bytes. For the TEXT("1 2 3 4 5") constant it will
be at least 18 bytes. Also are you sure the s/w on
the other end can handle correctly UNICODE strings?
That's a good suggestion... I'll try sending "unsigned char", so every array element is a byte.
- Why don't you verify the returned result from the
WriteFile() and GetLastError() code?
WriteFile sets the parameter "nOfBytesWritten" (or a similar name) to the number of bytes that I've actually chosen to write, so the funcions returns a correct feedback I think.
I'll make some experiments and let you know... Thank you.
- References:
- Serial communication problems
- From: Marco Malentacchi
- Re: Serial communication problems
- From: voidcoder
- Re: Serial communication problems
- From: Marco Malentacchi
- Serial communication problems
- Prev by Date: Re: Serial communication problems
- Next by Date: Re: What is the better development tool?
- Previous by thread: Re: Serial communication problems
- Index(es):
Relevant Pages
|