Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   USB Newb Question (http://www.programmingforums.org/showthread.php?t=14430)

KaibutsuX Nov 13th, 2007 1:49 AM

USB Newb Question
 
Hey all,

This is my first post and I'm just looking for some information. I'd done a little bit of research but I'm not even sure what I should be looking for so I was hoping you guys could help.

Here's what I'm interested in. I want to control my Canon 300D SLR via the USB port on my Sony PSP most likely through C++ compiled for my PSP's firmware. All I'm interested in is simply tripping the shutter and holding it open for bulb exposures if times that can be selected in the software.

My problem is I have no idea how USB works or how to access/send signals from code. But I do NOT need to send data, I simply need to emulate closing a circuit in the USB cable. I'm assuming thats what I need to do because I have a self-built shutter release using simple electronics parts. It consists of a box with a toggle switch and a push button. The control then interfaces with the camera via headphone jack. So all the power is supplied via the camera's jack, and when I push the button, the circuit is complete.

But now I want to know how to do this exact same thing but using software and USB. Obviously my USB cable will have one end in my PSP and the other will be spliced into a headphone package.

So if anyone could give me any web resources or any advice on where to start looking to research this I would appreciate it. Obviously I will need to to know the pinout diagrams for USB so that I know which pins to splice to the headphone jack and then I just need to know how to "close the circuit" via software. Don't worry about the PSP stuff, just assume I was doing this on the PC.

I appreciate any help you guys/girls can give me.

Thanks,
Sean

mrynit Nov 13th, 2007 2:12 AM

Re: USB Newb Question
 
first make sure you can even do this. is there a C++ ,or some other language, compiler for your modle/version of the PSP. Look to see if anyone has alread done usb controlling software on a PSP. if the answer is no to any of these then you got a lot of work cut out for you.

KaibutsuX Nov 13th, 2007 3:04 AM

Re: USB Newb Question
 
From what I can see, there are no homebrew apps that utilize USB interface. However I think the PSP situation should be irrelevant right now.

In the simplest example of what I'm trying to accomplish, imagine that you had a USB cord plugged into your PC. Then stick a 5V LED into the other end of the USB cable. What kind of code would be required to close 5V circuit and light the LED?

If that is possible, then I can figure it out from there.

DaWei Nov 13th, 2007 9:59 AM

Re: USB Newb Question
 
I would suggest that you do some research on USB. USB is a serial interface comprising 2 data wires (90 ohm impedance) and 2 power wires. Unlike RS-232, there are no "level oriented" signals (RTS, etc.) to switch. All operations are achieved by data communications between the host and the device.

It is not absolutely necessary that the device come with a device driver, though some may. This is because there are several predefined "device classes" for the more common types of devices. A host is supposed to support these classes, but not all do.

You sound a little behind the curve on both the software and hardware characteristics. You might wanna remedy that before you go around sticking paper clips into the socket.

DaWei Nov 13th, 2007 8:04 PM

Re: USB Newb Question
 
I did some looking around. There are a number of USB interface boards available, including experimenter's breadboard types. These come with USB controllers on them, set up to provide various kinds of I/O. This one has 12 bits of I/O: 4 out and 8 in. There are 4 LEDs you can jumper to the outputs, and a DIP switch to control the inputs.

It's 29 bucks for the kit, 34 assembled.

You say you need to close a circuit. I don't know if you mean you need a contact closure or to yank a signal to ground or Vcc. If it's a contact closure, you need to know the impedance, so you can choose an appropriate FET, or possibly a mini-relay. You should be able to adapt your existing shutter release.

KaibutsuX Nov 13th, 2007 9:41 PM

Re: USB Newb Question
 
Thanks DaWei, I think this is what I've been looking for.


All times are GMT -5. The time now is 3:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC