PDA

View Full Version : Astronomy Hardware - converting serial to USB and DC Motor control via PC



Scampy
- 16th April 2011, 17:20
Guys,

Recently got back into astronomy and purchased a computerised goto 8" Newtonian Reflector, and was amazed at all the electronic gismos and software that's on the market, both retail and DIY for controlling the scope and camera's etc. However most seem to be based around RS232, and work by making the RTS and DTR lines go high and as most of the new netbooks and notebooks only have USB ports, have to resort to using clunky serial to usb converters.

Is there any simple way of using a PIC (say an 18F2550) with USB port(s) to work in the same way... or would it require some form of driver to work ? There is a standard called ASCOM which a lot of these devices use, which is also open source, but is way above my level of understanding.

One project I would like to get off the ground is the ability of controlling a DC motor used as a focuser. The idea being that you can set the rate at which the motor would run by pressing 0 to 9 on the keyboard and then use the left / right or forward /back arrow keys to make the motor run. Again via USB if possible

Any pointers or ideas would help

Malcolm

Archangel
- 17th April 2011, 01:34
Hi Malcom,
I believe most of the PIC USB gizmos log into the PC as an HID type device, using generic drivers. You could go with one of the USB interface miniboards like viniculum or even I think Parralax sells one too. Only issue I see with HID is it is a bit slower than Full speed USB, certainly slower than USB3. (USB 3 runs something like 287MBS ). Those devices have their own drivers license.

dhouston
- 17th April 2011, 04:00
It's not at all clear what you want to do. If you want to replace the laptop, then almost any PIC can send RS232 serial commands to the device. If you only wish to replace the USB-serial converters, there are some which are not clunky as well as single chip USB-serial converters.http://www.byterunner.com/byterunner/category=USB+to+Single+Serial+Adapters/exact_match=exact
http://www.ftdichip.com/Products/ICs.htm
http://www.silabs.com/products/interface/usbtouart/Pages/usb-to-uart-bridge.aspx
Either way, there is no need for a USB capable PIC if you are interfacing to an RS232 device.

dhouston
- 17th April 2011, 15:01
To elaborate on my earlier post...

Both FTDI and Silicon Labs have USB-Serial chips that also include GPIO pins. Since you also have the modem control lines, these may give you enough control. The drawback is they are surface mount chips. However, Spark Fun Electronics has them on breakout boards. They have schematics on each product page.

Spark Fun also has the USB Bit Whacker which is a development board for PIC18F2553. It has numerous GPIO pins.

All the above are here...http://www.sparkfun.com/search/results?term=USB+to+Serial&what=products

The product page for the USB Bit Whacker is at...http://www.sparkfun.com/products/762

All of these are seen as virtual serial ports on a PC. I've not tried the Bit Whacker but have used FTDI, Silicon Labs and Prolific chips and all work with Windows, Linux and OSX. Most are recognized by the latest versions of Windows and by the Linux kernel and you do not need to install drivers. OSX recognizes them but you must install the driver to use it.

Scampy
- 17th April 2011, 19:01
It's not at all clear what you want to do. If you want to replace the laptop, then almost any PIC can send RS232 serial commands to the device. If you only wish to replace the USB-serial converters, there are some which are not clunky as well as single chip USB-serial converters

Thanks for the links. Yes basically I was wondering if there a simple way to use a PIC with a USB rather than using RS232 with a RS232 to USB converter.

For example, I currently use a cable release for my canon camera. This uses the DTR line to activate the shutter (ie DTR stays high for 10 seconds as controlled by the software on the PC). This is one example.

The other is a focuser.. this uses a handset with simple push buttons to control the motors direction. It would be great if you could remove the cable from the handset, plug it into a small box with a PIC inside and plug that into a laptop via USB and use the arrow keys on the keypad to control the motor..

Hope that makes things clearer ?

Malc

dhouston
- 17th April 2011, 21:15
USB is doing it the hard way on both ends of the line. If you really want to go that way take a look at Jan Axelson's USB website...http://www.lvr.com/usb.htm

Both of your examples can be done simply and easily using the CP2103 breakout board from Spark Fun. You have 4 GPIO pins which you can control from the PC.

The USB Bit Whacker gives you a great deal more power. You can create your own PBP programs and download the hex file using the USB bootloader.

Both connect via a USB cable but appear like COM ports to the PC allowing simple serial commands to control them. The only drawback is they are a bit slower than pure USB because they translate between serial and USB.

kellyseye
- 18th April 2011, 00:05
Due to the lack of handshaking signals on 'some' USB-to-serial cables there are now a number of 'recommended' USB-to-serial leads that are used in astro control systems. Pop in to http://www.ukastroimaging.co.uk and enquire. You will also find articles on focussing etc that might appeal.

Scampy
- 18th April 2011, 18:38
Thanks once again for the input. Having ready the datasheet and application notes the CP2103 seems like an ideal option...

@kellyeye Thanks for the link, will take a look now

picster
- 16th May 2016, 23:04
I've looked at piggybacking signals on the controls for MEADE. Autostar has "Meade Telescope Serial Command Protocol" via ASCOM that includes commands for focus (and you could just "listen in" on the receiving end).

Ioannis
- 26th May 2016, 09:22
If your gear is using RS232, why are you messing with USB?

Ioannis

Scampy
- 26th May 2016, 16:38
Ioannis, I started this thread five years ago, and since then commercial items have appeared on the market, so opted for that.