Monday, May 21, 2012

USB-to-Serial Adapter to PICAXE Com Test

Pololu and SparkFun market inexpensive USB-to-Serial adapter board modules (P/N 391 and FT232R), that with the appropriate drivers appear to both the computer and the client as serial com ports. This really simplifies USB connectivity. I thought it would be fun to wire this to a PICAXE-18M2 microprocessor and see what could be done with it. The end program permits a terminal program on a PC (like Teraterm or Hyperlink) to send commands to the microprocessor to either retrieve telemetry or to turn an LED on or off. To feed the microprocessor's ADC input I connected a potentiometer form Vcc to ground and the wiper to the ADC. From the terminal, if I type "l" the LED lights up, "d" extinguishes it (l for light, d for dark); "r" reads the ADC and displays the byte value. Incidentally, the USB connection also powers the entire project.

Link to Video [Link]

Link to BASIC code [Link]

Link to Wiring Diagram [Link]

Link to USB Module Specs [Link]

Link to my other interests [Link]

1 comment: