Would it be possible to send a 5 V "true" signal from the Tx of a UART dongle? As if it were a digital output?
Here is the UART adapter I purchased.
(1) The module you linked to has TTL output levels.
This means that RXD will be at 5V in the idle state, a start bit will be 0V, data bits will be +5 for logic 1 and 0V for logic 0 and sytop bits will be 5V.
When data is not being sent V_RXD will be 5V.
If you send a $00 signal (00000000 binary) the UART will output
If you resend successive $00 bytes at maximum channel speed the output may be as low as 0.5V DC when suitably filtered. Depending on hardware and the USB interface and PC configuration and the phase of the moon you MAY get interuptions between btes and see occasional 5V signal level.
If you add a very simple RC + diode filter such that a RDX low discharges the cap immediately but charge up is via the resistor you can get low output during periods that the TXD line is high for limited periods.
Whether an RC+D filter suits your needs depends on the data rate you want and system behaviour. If this is to control something that needs slow response - say 1 second or longer between changes and slow low to high change is acceptable, then this could work well for you.
(2) External UART:
A better method is to add an external UART at the receiving end and decode the serial signal to a parallel word. This gives you 8 bits of on off.
(3) If you want something already built that does what you want buy a USB to parallel port (printer port) converter - this gives 8 (or more) lines of on/off control from USB. Many on ebay. Here is one for $US2.66 buy now withe free shipping !!!!!!!!!!!!!!!!! . Many more similar. Some people have commented that this may have printer functionality but not parallel port functionality. If so it should still be usable. At worst you may need to latch the data at "print time".
Indented text added as a result of a comment by CS:
Look at the bottom of your USB to TTL converter - it may have RTS/CTS and perhaps other signals available. If so, one or more of these can be controlled as an output.
See photo below. This is your unit. Note holes marked by red lines.
The photo below is a unit sold on a local auction site.
|show 4 more comments|
I did not think you crazy for asking, even though the answer was clearly 'impossible'.
On your new question: yes, you can probably control the level of the Tx pin, by either sending nothing at all, or setting the 'break' condition. (but the break condition is not very well sepecified, it might be that some OSes or drivers interpret it as having a limited time. IME Windows and Linux do NOT fall in this category.)
But it is probably far easier to set the levels of the various control pins. How this is done depends on your programming language and library.
When you use a standard serial port or an off-the-shelve usb-to-serial converter you het outputs at RS232 polarity (=inverted) and level (-10V / +10V or something like that).
It is probably easier to use a 'bare' converter chip, without the RS232 level shifter. FTDIchip makes some, check http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm
IME usb-to-parallel converters are useless for your purpose, because they create a virtual printer port, not a virtual parallel port.
I don't think you can keep the TX pin high or low at all times. Every byte you send will have a start bit (logic low) and a stop bit (logic high). Your best bet would be to get a usb-to-uart adaptor that has DTR and/or RTS pins. These lines can be toggled easily.
This answer is only as good as your question, which is not that good really, as you don't give many details. If you tell us what exactly is that you're trying to do, what hardware you have (and so on), we might be able to give you a better advice.
My first question would be this: If you have an arduino and a relay module for it, why do you have to use some roundabout way to solve your problem?
The CP2102 supports DTR and RTS flow control signals. These can be used as USB controlled outputs.
From the looks of the ebay picture you posted, the pins are routed to J2 or J3.