Shop OBEX P1 Docs P2 Docs Learn Events
Connecting SX Controller to USB 1.1 — Parallax Forums

Connecting SX Controller to USB 1.1

RobosoftRobosoft Posts: 4
edited 2006-01-24 21:34 in General Discussion
I have been trying to find help on connecting the SX chip's Directly to a USB port (with the least components).

I Know you can get PIC chips to do the job out of the bag.· But the SX Chips are faster.

Am i Waisting my time??

Anybody got a simple diagram/code to flash an led from windows trough the USB Port???


Sorry if this topic has already been sorted.

Thanks

Rob..
·

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-01-23 16:49
    Rob,

    ·· The FTDI FT232BM and FT232/R chips allow you to connect any microcontroller to the USB port as a Virtual COM Port.· Is this what you mean?· When using the FTDI chips the device will appear as a COM Port and the PC and Device will communicate serially.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-01-23 16:51
    The speed isn't the issue, it's the protocol layers that need to be implemented in order for it to succesfully operate on a USB bus. Once you've implemented the stack and the different protocol layers, you are basically left with no variable space and very little program space to do anything else. FTDI makes excellent USB chips which does all of this for you and provides an easy to use UART interface, at a reasonable price. So noone ever bothers with doing this on the SX itself, its one of those "Why reinvent the wheel" scenarios. An additional issue not always covered is the PC's programming interface to the USB port which is also quite an issue, FTDI and other USB chip makers provide an equivalent USB->serial port software interface to ease the migration from a RS232 solution to a USB solution with minimal code modifications.

    Most of the competing chips which support USB interfacing have an integrated USB controller on the chip to handle the same function as the FTDI, a run of the mill PIC is no more capable of interfacing with USB than an SX is, in fact it is ussually less so because they frequently have less data space than an SX.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10

    Post Edited (Paul Baker) : 1/23/2006 4:56:10 PM GMT
  • RobosoftRobosoft Posts: 4
    edited 2006-01-23 19:03
    Thanks,

    Ok next question,· where can i get an all in one tutorial start·to finish that is

    vb aplication·->> driver·->> circut diagram·->>·sx code·->> flash an led?

    As i don't want to re-invent the wheel either.

    These USB -> Serial chips look like they will be ok the costs still mount up for all the extra bits needed.

    Ill be sorted once i see it runnin a flashing led·or better still a simple "send two numbers and return an answer" so that will show bi-direction.

    Would be forever greatfull.

    Thanks Rob. UK



    Anything on scarp paper!!··
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-23 20:00
    Rob,

    I think the "simplest" way is to use our USB2SER:

    http://www.parallax.com/detail.asp?product_id=28024

    We include the schematic with our docs and I know of one SX customer who has successfully built his own.· After that, it's real easy: VB sends a serial message to the SX, the SX does what you want it to do.· This article shows a simple serial slave I made with the SX that connects to a terminal program -- you could simply have VB send the strings instead.

    http://www.parallax.com/dl/docs/cols/nv/vol6/col/nv125.pdf

    I hope this helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • RobosoftRobosoft Posts: 4
    edited 2006-01-23 21:29
    Ok now we are cooking on gas.

    The USB2Serial Dongle seems to have rather a large amount of components on it· (for me that is).

    I was reading up on the usb-serial chip, and it mentions that the new ones have a built in eprom and OSC.

    Would that eliminate some of the bits off this design?

    Im guessing the eprom is used to store the USB Product ID ?· -· if so how is that bit programmed.


    I tell you what i want to do...

    I have been looking at all the new USB·toys that were about at xmas and ive seen the following...

    http://www.robosoft.co.uk/hampster.jpg

    A·hampster wheel that revolves at the speed you type (including a fluffy hampster).· it retails @ $30ish.· (sorry im in uk so im guessing it actualy was £15).· which is amazing considering the fluffy toy + wheel + usb cable + electronics + software disk + packaging + retailers profit is in that low price.

    So if i were to make somthing like that it would cost too much, even if i was to purchase these units in the 1000's·· not that i want to do any thing commercial at this stage.

    I·think i will get one of these anyway as i·think this would·make a good test tool·as a·known worker!·· As i am most impresed with the quality of all the other products parallax has sold me.

    But if there is a simpler design template that could be used on every project.

    Many thanks...

    Rob..
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-23 21:35
    That version uses an older USB chip from FTDI -- they've just recently released the low-component-count version and we've started moving it into our products.· Here's the link to it:

    http://www.parallax.com/detail.asp?product_id=604-00043

    And have a look at the example schematics on this page:

    http://www.ftdichip.com/Documents/Schematics.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 1/23/2006 9:38:21 PM GMT
  • dkemppaidkemppai Posts: 315
    edited 2006-01-24 00:23
    Robosoft said...
    Ok now we are cooking on gas.

    The USB2Serial Dongle seems to have rather a large amount of components on it· (for me that is).

    I was reading up on the usb-serial chip, and it mentions that the new ones have a built in eprom and OSC.

    Would that eliminate some of the bits off this design?

    Im guessing the eprom is used to store the USB Product ID ?· -· if so how is that bit programmed.

    I have not played with the new ones yet, but I use the FTDI chips quite a bit. I prefer to use the FT245 series of chips (Parallel interface to the SX).

    The throughput is very good with these chips. I've been able to transfer 700kB per seconds (Kilobytes, not kilobits). Programming the eeprom is a little more difficult if you want to write your own program, but luckily, FTDI provides an program for doing so free of charge (http://www.ftdichip.com/Resources/Utilities.htm). Look at the program Mprog.

    Be careful playing with the pid/vid. You can do so as a hobbiest on your own pc,·but I would not recommend selling anything with PID/VID that you don't own (or have rights to!)·Also, if you use anything but the default pid/vid, you will have to rewrite the .inf file supplied with ftdi drivers to allow windows to load the drivers for the hardware. If you program a PID/VID that you don't have drivers ready for, it can be a little tricky loading the drivers (that you have to modify) to reprogram the PID/VID to something that the default drivers will recognize...··· ...but again, I believe FTDI has a program to help you out there too...

    Anyway, I'd recommend the FTDI stuff to anyone who wants to talk to a PC via USB. They work very well for that.·They are capible of·some·very high data rates.

    -Dan
    ·
  • PJMontyPJMonty Posts: 983
    edited 2006-01-24 04:33
    Rob,

    That link with the USB hamster is pretty funny. I couldn't find the product on their website. Do you have a link to the page where they actually sell this gizmo?
      hanks, PeterM
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-01-24 19:34
    Hi Robosoft, the USB2SER from Parallax will make your life easier and if I were you I would use it to build the first prototype.

    For production models where price per unit is an issue, you can buy the FTD232 chip for about $5 each and pay another dollar or so for capacitors, resistors, and a ferrite bead.

    This will require a little more work on your part since you will need to make or buy a custom circuit board and understand the communication protocols.

    The USB2SER is an excellent way to get started but it only gives you access to the minimal capabilities of the FT232 chip.

    For example, you do not have access to the pins that are required to handle system sleep mode, and therefore cannot construct a USB compliant device that is powered by the USB port (like the USB mouse) unless the entire device draws less than 500 microamps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • RobosoftRobosoft Posts: 4
    edited 2006-01-24 20:21
    First

    The hampster is from a company in uk called "marks & Spencer"·· -·· a well know retailer here.

    I was reading that you can apply for 8 free aplication id's·for the chip.· so im gessing its just a case of appliying for those and setting them and masking them into the inf file so i can say "New hardware found"· - "Hampster"

    Is it possible to have this device listed in device manager but not under the ports section but in say the USB section.

    I was reading an interesing artical for a USB - VGA Adaptor where the Screen is grabbed and sent through the usb to a standard 15pin monitor.· so if you use these usb-serial chips it would be good if it installed under the "Display adaptors" heading in device manager.

    Im going to get the usb2serial adaptor and a few of the new all in one chips to play with.

    Do thay do a usb2 version??

    I fancy making a high speed laplink style cable which should be simple to do !!!????· this will give me a look at bi-directional and max speed etc.


    ·
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-01-24 21:34
    Hi robosoft.

    Yes, it is USB2.0 compatible.

    Here's a link to the manufacturer's web site:

    www.ftdichip.com/

    There is a lot of good information here including application notes with schematics and a good overview of USB protocol.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
Sign In or Register to comment.