Shop OBEX P1 Docs P2 Docs Learn Events
stamp controlled USB????? — Parallax Forums

stamp controlled USB?????

Velvet LeopardVelvet Leopard Posts: 47
edited 2004-08-16 19:34 in BASIC Stamp
Can a basic stamp control a USB device such as a three button scrolling optical mouse????· Just wish to know.· I was rambling through the parallax home page and saw the ads for FTDI.· Will these FTDI chips and adapters allow the stamp to use USB???!!!

Post Edited (Velvet Leopard) : 8/15/2004 4:52:33 AM GMT

Comments

  • jakjrjakjr Posts: 88
    edited 2004-08-15 04:55
    I just took apart a small microsoft (USB) optical mouse. My findings were:

    The wire that plugs into your USB port is made of 4 small wires and one slightly larger wire. The wire colors are as follows (small wires) red, black, white, green (large wire) black.

    I checked out the circuit board and found that the small red wire and the small black wire are apperently positive and negative, I guess they supply power/ground the circuit. the larger black wire is apperently another ground wire as it it conected to the smaller black wire.

    The green and white must be the output wires.

    we are geting ready to leave but when we get back Ill check out the circuit board some more and see if I can figure out what the green and white wires do.
  • Velvet LeopardVelvet Leopard Posts: 47
    edited 2004-08-15 05:03
    WOW!· Thanks, jakjr.· I didn't expect anyone to thrash a mouse to tell me how it works.· Cool.· I only have one here to use, so I don't want to thrash it.· If I could use it for my project in SOME way.· That would be soooooo sweet.· Maybe I can use that AND the PS controller on my project.· I wish I knew more about circuit boards.· Then I probably wouldn't have needed to ask that question.· If you have the time, how the Smile do you find out what I/O wires or pins do!?!?· I would like to learn how to do that.· Thanks alot for your help, man.
  • jakjrjakjr Posts: 88
    edited 2004-08-15 07:05
    Actually I didnt have to trash my mouse at all, It came apart pretty easy in fact after im through experimenting I can put it back together and it should work fine.

    Anyways, I plugged in the usb cable into my pc and tested it with my voltmeter, it put out 5 volts. Perfect for interface with the basic stamp.

    So... aparently if you hooked up the mouses + pin to the stamps VDD and the mouses - pin to the Stamps VSS it should get adaquate power to run it.

    Im sorry but I just couldnt figure out the exact useage of the green/white wires. This circuit board has some sort of microcontroller (model # CY7C63001A- brand name unknown) and although I could trace which pins the green/white wires going to (on the micrcontoller that is) I couldnt figure out where the leads coming off the buttons/wheel were going because some of the printing went under the microcontroller and without actually removing it I cant tell whats going to what.

    My best guess would be that they are both outputs, one being for the left/right buttons (and posibly the 3rd button under the wheel) and one being for the scroll wheel (and possibly the 3rd button).

    My guess is this mouse could easily be interfaced with the BS2, but you would have to figure out how to decode everythign the mouse sends to the PC when movement is detected.

    Hopefully somone else knows more about this as I would like to get this project working. It would be neat to be able to control my BOE-bot with a mouse.

    If you want pics of the "guts" of my mouse let me know.
  • jakjrjakjr Posts: 88
    edited 2004-08-15 08:21
    Update....

    Upon further inspection of the USB "plug" (if you will) it apears to have 4 contacts inside of it, I suspect these are connected to the 4 smaller wires inside of the lead wire that goes into the mouse, and I beleive the larger black wire is connected to the metal casing of the USB "plug".

    I now beleive that since all male USB "plugs" have these same 4 contacts inside that one must be +, one -, one input, and one output. Thus making the green/white wires inputs/output NOT two outputs as I had orignally thought.

    Now heres the kicker, if the green/white wires are infact input/ouput why in the world would a mouse need input??? What would the PC need to tell a mouse? Seems like they would have just left it out and saved money on the extra wire needed.

    One more question arises, which wire is output and which input? For some reason my gut tells me that the white would be output, but I dont know for shure.

    Anyways, I strongly think its possible to interface an optical mouse with the BS2, if a playstation remote can do it I dont see why soemthing made for a computer cant.


    Post Edited (jakjr) : 8/15/2004 9:37:04 AM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2004-08-15 08:33
    Gents -

    You may find many of these pinouts and diagrams helpful for your present investigations, as well as those in the future:
    http://www.networktechinc.com/technote.html

    Regards,

    Bruce Bates
  • jakjrjakjr Posts: 88
    edited 2004-08-15 09:30
    Wow, I never imagined anyone else stayed up as late as me, Its 4:30 A.M. now and im just starting to get tired.

    Thanks for that link, now I just need to figure out what data +/- means, I guess + would be output?

    Post Edited (jakjr) : 8/15/2004 9:35:30 AM GMT
  • danieldaniel Posts: 231
    edited 2004-08-15 11:57
    If you like the adventure of solving this puzzle, don't look here for information:

    Jan Axelson's 'USB Central'· http://www.lvr.com/usb.htm

    USB 2.0 Specification· http://www.usb.org/developers/docs

    Also keep in mind that the USB mice can operate either as USB devices or as serial devices [noparse][[/noparse]edit: that is,·as PS/2 connected devices].

    HTH,
    Daniel

    Post Edited (daniel) : 8/15/2004 12:16:11 PM GMT
  • cyberbiotacyberbiota Posts: 79
    edited 2004-08-15 12:58
    Dear All-

    The CY7C63001A chip is a Cypress Semiconductor Corporation USB controller.· You can check out the (very scary) specs at:

    http://www.cypress.com/products/datasheet.cfm?partnum=CY7C63101A

    These are not your pop's MAX232 chips- they are complete MCU's with multiple I/O, ram, FLASH and a monster double-pumping ALU.· That being said, once the firmware is in, they are pretty easy to use.· For more info, check out (as usual) Jan Axelson's amazing "USB Complete V2."



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dr. Peter C. Charles

    Director, Research and Technology
    CyberBiota, Incorporated
    Peter.charles@cyberbiota.com
    http://www.cyberbiota.com
  • Velvet LeopardVelvet Leopard Posts: 47
    edited 2004-08-15 18:11
    WOW!· Lots of great info.· Thanks all.
  • jakjrjakjr Posts: 88
    edited 2004-08-15 20:49
    Should I hook up my mouse to a BOE- board/BS2 will I need to use a resistor(s)? and of what value (220?)

    Also, does anyone have any idea's of what kind of code to use to decode what the mouse normally outputs to the PC when movement is detected?

    Post Edited (jakjr) : 8/15/2004 9:04:40 PM GMT
  • Velvet LeopardVelvet Leopard Posts: 47
    edited 2004-08-16 04:37
    Hewwo, all.· I have been reading up on the USB thing in like about 100 links and sites.· All I seem to find is specs for PC usage and data transfer.· Nothing about how USB actually works.· I read that any and all USB devices and applications require special chips or chipsets in both the device and the "host"· the stamp in this case.· Is this true?· I hope not, because I really want to integrate my USB mouse.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-16 04:47
    USB is a nightmare to implement, hence the specialty chips. How do I know this? Because my boss, Chip -- inventer of the BASIC Stamp and one of the smartest guys I've ever met -- waded through pages and pages of the USB specification while I was at his house several months ago (everyone else was playing Xbox). It's not simple, and that's why we've taken on the FTDI line. We've found it to be a clean implementation and works well for us.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • ErnieErnie Posts: 20
    edited 2004-08-16 19:19
    I have actually got a PIC (PIC16C765) to work with USB and thus I qualify for the T shirt... it is no simple task.

    I would not have got even my·simple test app to work if I did not use the Mircochip USB development board (PICDEM USB) and just some simple modifications to existing example code. Plus I have available multiple programmers for PICs that work with MPLAB.

    If that is Greek to you, you have a very steep curve to walk up to use these parts. I'd definately suggest go with·Jon Williams suggestion of something like the FTDI serial to USB converter.

    Even with the FDTI converter you can expect a steep learning curve.
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-16 19:34
    As I pointed out, we have a USB-to-TTL (serial) interface coming soon -- you can see a picture of it in Nuts & Volts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
Sign In or Register to comment.