Friday, 7 October 2011

Levelling Out

I bought a USB-to-Serial converter a while back to play with that had the large standard USB plug (rather than a socket). These modules have a CP2102 chip on board which uses the 3.3V standard so the only issue I had with it was a level change problem from 3.3V to the 5V I'm using with my 16-series PICs.
I turned up a very neat bi-directional solution using just one MOSFET and 2 resistors for each channel (see above). Even though the transistors are surface mount(i.e. tiny) this was easy enough to build and the USB converter now works a treat, so much so that I bought another one with a micro USB socket which I think would be more use mounted into an actual project. Not only that, but early indications seem to show that this version doesn't have a problem with the voltage level shift and is working quite contentedly with the 5V PIC circuits.I've been communicating with these units using the Gambas2 programming language under Linux. Gambas2 is similar to Visual Basic although the developers stress it is not a clone. Under Linux, opening a connection to a USB serial port is as simple as calling up 'ttyUSB0' and off you go. Try doing that in Windows!
The next step is to use the bar graph programming example in Gambas2 and modify it to lift data from the serial stream coming in from one of these modules.

(If I ever get time...)

No comments:

Post a Comment