HSEROUT question


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT question

    Al,
    I think the cable connection is probably my problem as you mentioned, going from device to device without the computer. I'm in India at the moment and due to some strikes and other stuff going on, I'm limited to be able to get a actual cable. So I took regular USB cable, cut it open and then crossed the green and white wires (D+ and D-) and left the red and black alone. I then plugged this into the usb to serial cable and I still didn't get anything.
    I then put the white and green back just to make sure it still worked normally when hooking the device to the computer and it did.
    So did I miss something? Logically this made complete sense when you mentioned it and I was dissappointed when it did't work. I've also got some questions in to the tech support group for the other device to see what their take on this is.
    Thank you,
    Hylan
    Last edited by Hylan; - 24th February 2011 at 05:21.

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT question

    Hylan, I am a little lost! Let 's do step by step an analysis of your system.

    1) Very likely your PC (laptop) has no serial port so you are using an USB to serial converter.

    2) Your different device that operates at 2400 bauds is a RS232 serial device, which means that you will connect it to the PC via a serial cable. This serial cable should have two DB9 connectors, one to be inserted into the corresponding DB9 on your device and the other into the DB9 (male) of your USB/RS232 converter.

    3) Your PIC board MUST have a RS232 connection since you are using the HSEROUT command, so I assume also this board has a DB9 connector.

    It is possible that you plug the USB/RS232 converter directly (via DB9M to DB9F) to your boards, so you are not using a serial cable.

    Now you need to made a serial cable for connecting your pic board to device that operates at 2400 bauds. This is not very difficult. You have to obtain two DB9 connectors that plug respectively into the pic board and into the 2400 bauds device board (these two boards should have a female conectors, if so you will need a males couple. But you do better check)

    Once you have the correct DB9 connectors you should wire them in this way :

    DB9 (pic device) DB9 (2400 bauds device)
    --------------------------------------------------------
    Pin 2 ----------------------> Pin 3
    Pin 3 ----------------------> Pin 2
    Pin 5 ----------------------> Pin 5
    ---------------------------------------------------------

    Make the cable long as you desire, but not longer than 2 meters, plug this cable into the two devices, power up both devices and run your code, 2400 bauds device should receive the serial string you have coded.

    Please note that a RS232 serial cable is not an USB cable.

    Good luck

    Al.
    Last edited by aratti; - 24th February 2011 at 06:15.
    All progress began with an idea

  3. #3
    Join Date
    Sep 2007
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT question

    My device has a USB B female connector on it. The hserout command goes to an FTDI (FT232) chip which then outputs over the USB connector. Normally my device functions as a client feeding information to a computer.

    However, I would like to feed control information over to another device(audio file player) that normally functions as a client when connected to a computer. The audio player has a serial (db9) connector.

    So what I tried to do initially was plug a standard USB cable into my device (using the USB B connector). Then I put a gender bender on the other end of the cable and plugged a USB to serial adapter into the gender bender and plugged the db9 into the audio player. This didn't work.

    So the last thing I tried was to switch the D+, D- lines in the USB cable. And that didn't work either.

    I just looked up the pinnout for the DB9 and I don't see a vcc pin like the usb. So I'm wondering if there is a problem with leaving the USB #1 and #4 pins connected the way they are. Unfortunately I don't even have a multimeter with me. I will try to get out and find one today and test this to make sure pin 5 on the db9 is to gnd.

    let me know what you think.
    Thank you,
    Hylan

  4. #4
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT question

    USB and RS232 are both called serial ports because they send data serially, but they are VERY different interfaces and can NOT be connected to each other. HSEROUT has nothing to do with USB. Please look up the specs for both of these interfaces, then you'll need to return to square 1.

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT question

    For your board to talk to the device, you will need to stop using the FTDI converter. you have interface incompatibilities here.

    As I understand it, this is you setup:
    PIC ->non-inverted serial->FTDI->usb->PC (with virtual com driver prolly)
    Other device->true serial->USB adaptor->PC (with virtual com driver prolly)

    Just connecting the USB to USB will not work.
    connecting non-inverted serial <->true serial will not work

    I see 2 choices:

    Add a level converter (MAX232) to the PIC serial then connect that to the other device true serial
    or
    Use 2 new pins and SERIN/SEROUT so you can make true serial data without the converter. I think this should work unless the other device needs RS232 levels (-12 to 12 V). In that case you will have to use a MAX or simular converter.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Sep 2007
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT question

    Bert you are correct in your description. I was wondering if the FTDI chip was causing a problem. I had posed that question to the audio device tech group and hadn't gotten an answer yet. When I plug my device into a computer, it has to load the drivers in order to function. However, with the audio device, it has no way to do this.

    I'll check my schematics and board layout and see if I have another pair of pins I can output to or if I can tap into the trace at a via before the FTDI chip to get the raw signal.

    Thank you,
    Hylan

  7. #7
    Join Date
    Sep 2007
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT question

    Update: unfortunately not a good one.

    I have two versions of my hardware, one of which actually has direct pic to pin access. I used this board to bypass the USB chip and try to go directly to the other audio device with no luck. My device is already in production and this is just a single variant I'm trying to create for a single test, so changing the board is not an option.

    I haven't fully given up but am close. This seemed simple in concept but has proven otherwise. I'm currently looking into a small linux based single app computer that could basically function as a host just to capture and pass the signals betweent the two devices using a java program.

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts