Shop OBEX P1 Docs P2 Docs Learn Events
Make a USB Interface — Parallax Forums

Make a USB Interface

Has anyone built a USB interface to a BS2 using any of the 16 I/O lines? I want to keep the four pins for serial communication to a program download computer.
My idea is to use the BS2 as a peripheral device for setting digital outputs, reading digital inputs, and reading analog input voltages then interfacing them to a laptop computer. I want to use the built-in serial USB interface for downloading new I/O configurations only.

The I/O built USB must not run on the PC's USB port protocol...it must be separate so that the USB interface can run all the time without any Microsoft generated failures.

Sincerely,
Discovery

Comments

  • You can always add a USB to serial interface like this one from Parallax or this one from Adafruit. Unfortunately, this won't fulfill your 2nd condition, that of not using the laptop's USB system. That's not possible. What sort of I/O does your laptop have?
  • Hi Mike,
    In earlier forum discussions, I detailed the problem I had with the Microsoft USB interface to my BS2's wherein after a few weeks of connection and display of data gathered by the BS2...the computer shut down and displayed a black and white message that a problem was detected and the machine was shutdown. After months of testing, it was found that the Microsoft code cannot handle a continuous exchange of data through the USB port lasting for months. For whatever reason, Microsoft detects a problem and shuts down the computer which causes a lot of problems with the pumps, lights, and other devices in my control system.

    Therefore, I want to bypass Microsoft and use code in my program to communicate data to the computer so that the computer can operate continuously for many months. I would like the new USB interface to be bi-directional.

    The laptop has three USB ports.

    Discovery
  • Mike,
    My explanation does not make much sense unless the Ethernet connection is used. So, the new program code would have to address the Ethernet port which would be connected to the BS2 somehow.

    Discovery
  • You're not going to be able to use the Ethernet port. How about using the Parallax WiFi module? There are a variety of examples using a Basic Stamp as the controller. I doubt you would be able to get an up-time of several months. What if a thunderstorm blows through ... you might have a brief power outage ... it only takes a fraction of a second. You have to plan on occasional disruptions and your system has to be able to recover from them.
  • Clock LoopClock Loop Posts: 2,069
    edited 2018-12-01 02:22
    Mike Green wrote: »
    How about using the Parallax WiFi module?

    Ive been running my "experiment" continuously now almost a year actually, and I will NEVER go back to a microcontroller wired to anything.

    Being able to program the chip and have it talk to my system via wifi has been like floating on cloud "WX"

    Seriously, get a Parallax WiFi module

    I don't think people still understand the power of these things to make your life easier.

    My uptime of 1/2 a year so far is rock solid. I wish I had these 5 years ago.

    And I haven't even begun to look into modifying the wx webserver files (which are open source), that will be exciting.
    I am looking to see if the cpu onthe wx webserver can run a terminal, it has limits on what the webserver can run tho.
    Then the webpage can have a debug terminal integrated into the file server.

    Customization, I can change the wx device to serve pages completely of my choice, facilitating the potential creation of a product with a web interface OF MY CHOOSING. (you can remove all the parallax logos, colors and pages IF YOU WANT, and put YOUR logo, colors, and pages...
    Thanks for the open source parallax!

    Depending on how complicated you need the pc side of it to be, you might be able to code your "interface" right on the wx8266's web server.
    Interface to the bs2 using the wx webpage in your computers browser. No need for the pc to even be ON, (depending on your needs)
    If you need help with the wx device, ask in the forums, many here are using these wx devices for the first time also.
  • Discovery,

    You could use WiFi but if you are considering wireless then what about a set of Xbee modules?

    Also, have you tried using a newer set of drivers from the FTDI website?
  • Discovery,

    Is this of any use?
    https://support.microsoft.com/en-us/help/2416007/an-usb-device-may-intermittently-disconnect-and-reconnect-when-you-use

    Also, from what I've read, USB will be reset when the computer USB controller loses power such as when going to sleep or hibernating.
    Check your power settings:
    1. Scroll to the right and type 'Power Options' in the search field and click on it.
    2. Click 'Change plan setting' on your chosen plan.
    3. Click 'Change advanced power setting' on your chosen plan.
    4. Find 'USB settings' and open.
    5. Find 'USB selective suspend setting' and change it to disabled.
    
  • I will look into the Parallax WiFi...thanks.

    Discovery
Sign In or Register to comment.