Wednesday, September 18, 2013

clone PL-2303HX USB to TTL serial adapters

USB-TTL modules using the PL-2303HX chip are the cheapest ones around ($1.40 from Fasttech).  The chip has a built-in 3.3v regulator, so the modules can supply both 5v and 3.3v power.  Drivers for them are included in the Linux kernel and in Mac OSX too.

Apparently the chip has been cloned, and as a result Prolific updated their Windows drivers to detect the clone chips and fail.  If you are getting "Error Code 10", the module will work with earlier versions of the driver.

For Windows 7 64-bit, this version works.  Unzip the file, then in device manager select device properties, update driver, have disk.  For 32-bit windows, this version works fine.

Besides its intended use, I have used it as a breadboard 3.3 & 5v power supply with a USB extension cable to a 5v USB power supply (or a computer USB port).

I also find the adapters handy as a simple voltage tester.  The T and R LEDs light up when pulled to ground, so I'll attach them to MCU pins to check for pulses.

Sunday, September 8, 2013

Control 6 LEDs with 2 pins using Gracieplexing

In my last post I explained Gracieplexing and demonstrated how to control 2 LEDs with 1 pin, an explained how 2 pins could be used to control up to 8 LEDs.  In this post I'll explain how to control 6 LEDs, and later do a third posting about a circuit to control the full 8 LEDs along with C code for Arduino-compatible MCUs to manipulate the 8 LEDs.

The following matrix describes how the state of the 2 MCU pins will map to the LEDs:
Using two pins independently us to control LEDs 1 through 4; the extra complexity is in controlling LED 5 and 6.  By wiring the extra 2 LEDs in opposite polarity between the two MCU pins, when one pin is high and the other low we will turn on LED5, and LED will turn when the pin polarities are flipped.  If we stopped there, we would have a problem though.  Turning on LED5 would also turn on LED3.  We can solve that problem by adding a standard (~0.6v) diode in series with LED3.  Using red LEDs with a Vf of 1.8v, a total of 2.4v will be required to turn on LED3, but when LED5 is on there will only be 1.8v.  However when the cathode of LED5 is not pulled low, the voltage will rise and turn on LED3.  In addition to the schematic I've done a Fritzing breadboard layout for connecting to an MCU.
And here's a video demonstration on a breadboard: