Connect with us

Controlling shift register via USB

Discussion in 'General Electronics Discussion' started by kermit, Sep 11, 2013.

Scroll to continue with content
  1. kermit

    kermit

    2
    0
    Sep 11, 2013
    Hi, I have a shift register circuit which I'd like to control from my PC. The circuit takes three inputs: data (serial binary sequence), clock, and latch.

    My first thought was to use three pins of the parallel port - it looks fairy easy to get started with sending data over these. But with parallel ports gradually becoming less common, I'm thinking it would make more sense to use USB.

    Breakout boards are an option, but ideally I'd like to do it myself: I've been looking at the FT* and MCP2200 chips. The FT230X looks ideal ('full speed USB to basic UART'), but presumably this only gives me one channel of output data. How do I send the clock and latch signals too?

    I notice the MCP2200 has 8 'general purpose IO pins'. Could I use these for the clock and latch signals?

    Or should I be looking at some sort of USB to parallel solution? Any guidance very much appreciated.
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    9,544
    1,971
    Nov 17, 2011
    These USB chips often have a "bit banging mode" of operation. This is just fine for controlling a shift register. See the documentation of the chip of your choice.
     
  3. Fish4Fun

    Fish4Fun So long, and Thanks for all the Fish!

    450
    103
    Aug 27, 2013
    Hey Kermit, welcome to the forum!

    The biggest problem with Serial/Parallel Port control of timing critical devices is not your PC, but you OS. If you are using Windows it is very difficult to get "precise timing". It **might** be better to simply use something like an Arduino "in the middle". In this scenario the Arduino would connect to your PC via USB and the Arduino would interface with your circuit. While even the UNO is likely 10k times more processing power than you need, they are dirt cheap, have a ton of support and will give you extremely tight timing (native clock speed is 16Mhz giving you 62.5nS resolution.)

    Good Luck!

    Fish
     
  4. kermit

    kermit

    2
    0
    Sep 11, 2013
    Thanks for the suggestions guys. Yes, using Arduino would be an option - I've used cheap Arduino clones from eBay in the past with good results (for different projects), but I think I'll give an FT* chip a go first (I like making life hard for myself).

    FT232RL does bit banging, but it seems that the FT230X does too ... and it's half the price, so I'll give that a go (the MCP2200 gets mixed reviews, and doesn't have a built in oscillator, so think I'll stick to FT*).

    I guess the timing issues would relate to process scheduling in the OS kernel? I'd actually be developing under Linux, but I'll certainly keep that in mind (and may well fall back on Arduino if it proves to be a big problem)
     
  5. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,267
    Nov 28, 2011
    I think you should be able to use the parallel FT device. You just need to send bytes to it in the right order, to make sure that the signal you use for shift register data is in the desired state before you assert the signal that's used for shift register clock.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-