This question is not exactly Arduino related. Suppose I want to switch 1 pin only from the computer. So I put an Arduino at the USB line and can control one pin. Fine but somewaht expensive for just one pin.
Then I fiured that one of the 8 pins AVRs would be sufficient but I would still need a USB --> SERIAL converter. But then it dawned to me that I can control DTR directly from the computer --> I can control one bit without any microcontroller at the other end, I just use DTR to drive a transistor.
This seems to work. Has anyone an idea if there is some hidden pitfall with this approach?
This seems to work. Has anyone an idea if there is some hidden pitfall with this approach?
The issue here is not so much the hardware interface, but the need for a driver on the host side. Writing a driver from scratch is not trivial (at least for Windows, but less so for Unix) and even adapting one from some of the open source initiatives will be challenging.
There is open source available (host driver and MCU firmware) that supports direct (software bit-bang type) USB communication for the AtMega's (168, 328) and some of the AtTiny's (e.g. the 2313). You may want to look at some of the projects from this initiative.
Not only can you control one bit you can also make a whole 8 bit port from the control lines of an RS232. I did this for another computer but the electronics is still the same. It is called PUP - Pseudo User Port. A way of generating one or two 8 bit parallel user ports from the handshaking lines on the serial port.
See:- http://www.doc.mmu.ac.uk/STAFF/A.Wiseman/Acorn/RTR96.html
The October issue.