Shop OBEX P1 Docs P2 Docs Learn Events
Help with USB — Parallax Forums

Help with USB

Steve AndruesSteve Andrues Posts: 29
edited 2013-05-11 22:48 in Propeller 1
I have a really neat data acquisition board that works through a 'Herculese' parallel printer port (for those of you who are old enough to know what that is). The DA board will not work with a Pentium class parallel printer port (the software configurable type). It's time to jump ship an convert to a comm port that might be around a while. USB maybe? Is there any primer, white paper, or app note that gives examples on how to implement a USB port, preferably for the Propeller chip? After reading Jan Axelson's book "USB port Complete" I have a headache and remain confused. Is this too much to implement with a Propeller (the only example I could find in the object exchange needs 4 cogs)? Should another serial protocol be used (PC's don't come with serial ports anymore)? Any feedback would be greatly appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-05-09 22:00
    I don't understand why you need to implement a USB port for this. You have a parallel printer port. It runs off +5V signals. You need an interface to it. You can use a couple of 74LVC244A octal buffers between a Propeller and the parallel printer port for voltage level conversion. Any of the Propeller project boards have USB interfaces that look like a standard serial port to a PC. You just need to write a program for the Propeller to talk to the parallel port in a way that makes sense using serial commands / responses from the PC like:
    PC -> Propeller "Send me the data from data port #1" ... maybe something like: S[1]
    PC <- Propeller "Here's the data" S[1]=1.235

    There is code available that acts as a USB host for a variety of devices, but the above would be easier. See here.
  • kwinnkwinn Posts: 8,697
    edited 2013-05-09 23:20
    @Mike

    I'm not sure it's quite that simple. If Steve wants to be able to run the data acquisition software on the PC he has to get the data/commands out to and in from the DA board to that software. If the operating system allows the printer port to be redirected to a comm port it might be possible. It has been so long since I have dealt with anything that uses a parallel port interface that I am not sure Windows supports redirection any more.

    If it is not possible to redirect I/O then new control software for the DA board has to be written. Might be simpler to write that for the propeller and use the PC as the data logger.
  • Steve AndruesSteve Andrues Posts: 29
    edited 2013-05-10 23:38
    The problem that I have is that Pentium class processors have software selectable mode for the parallel port (i.e. SPP, ECP, EPP) and somehow my AD board goes stupid on these ports. If I have to re-design the AD board (and software) it may as well be to something that is currently being supported. The current software runs under MS-DOS 6.22. I am having to make the jump to Windows. How do you get the propeller to speak USB without using all of it's resources?
  • jmgjmg Posts: 15,173
    edited 2013-05-11 00:14
    How do you get the propeller to speak USB without using all of it's resources?

    You don't, at least not directly.
    You use a Serial port-USB bridge chip, or module, and the Prop talks serial.

    Look at FTDI and SiLabs for examples. Chips start circa $2 and modules around $10.

    Does your existing parallel product use Prop ?
    Can it interface to 3V levels ?
  • kwinnkwinn Posts: 8,697
    edited 2013-05-11 12:42
    Have you looked at using a USB to parallel adaptor to connect to the AD board and running the software in a dos box under windows?

    It is probably a lot simpler (and possibly less costly) to buy a replacement data acquisition board that comes with windows software, but it might be worth a try.

    PS – Do you have the original manual for the AD board and does it have enough information to write a program to control the board?
  • Steve AndruesSteve Andrues Posts: 29
    edited 2013-05-11 20:32
    The AD board is home made around the ICL7109 chip operating at 5 volts. It has a relay matrix that allows me to read the voltage on any of 20 cells in a NiCd starting battery for jet aircraft. You pass the board the number of the cell you want to read and it spits back 3 nibbles which get masked into a 12-bit value. All of the code was written in Power Basic.
  • kwinnkwinn Posts: 8,697
    edited 2013-05-11 22:48
    Well, knowing that makes it much simpler. I have written a program for the propeller that fetches data from an ICL7135 and sends it to the PC via the USB to serial cable used for programming the propeller. Between the schematic of the board and a listing of the Power Basic program it should not be much of a problem modifying that program to drive your board. Could even have the propeller step through all the relays, convert the readings to decimal and send all 20 voltages to PST or some other terminal emulator program running on the PC.
Sign In or Register to comment.