Re: Serial communication problems

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




>>> - 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:

- How do you verify that it doesn't send anything?
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).

- 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.
.



Relevant Pages

  • Re: Google Instant Search = *bummer*
    ... only with hardware or software flow control. ... For hardware flow control, have you considered something like this? ... one of its own local control lines, until either terminal signals ... If the terminals want an ok-to-send signal as well for the reverse ...
    (rec.arts.sf.fandom)
  • Re: Events on Serial port
    ... | Can the fileevent readable be triggered by a flow control state ... This would usually be the case if hardware-handshake is used (after ... the device signals DSR, ... So after you see 'DSR 1', you send a query, and then the device sends ...
    (comp.lang.tcl)
  • Re: Events on Serial port
    ... | Can the fileevent readable be triggered by a flow control state ... This would usually be the case if hardware-handshake is used (after ... the device signals DSR, ... data in the serial port buffer, and then the application gets notified ...
    (comp.lang.tcl)
  • Re: RS-232 converted to INFRARED
    ... signals and how they dont seem to be used ... XON/XOFF, or software, flow control is). ... That circuit you've shown is overly simple. ... If you put it together into a real circuit, it may work but you might find ...
    (sci.electronics.design)
  • Re: Serial communication problems
    ... How do you verify that it doesn't send anything? ... first a led in the board which should turn on when serial signals are processed. ... the other end can handle correctly UNICODE strings? ...
    (microsoft.public.windowsce.embedded.vc)