Results 1 to 9 of 9

Thread: How to read and write data through USB

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    3

    How to read and write data through USB

    Hi all ,

    I have a PCM 2707 USB to I2S converter module.... This is connected to the USB port of the PC... The other part i.e I2S part is given to the transmitter board...

    So now i need to know , how i can send data to that IC through USB port???

    And at the receiver end (its a wireless module) , i need to tap out the Data line and connect it to the USB port...

    So at the receiver end how can i display the data collected , onto my PC through USB.....

    Please do help me out...

    Thank you

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: How to read and write data through USB

    What does Windows recognise the USB device as ?

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    3

    Re: How to read and write data through USB

    Quote Originally Posted by Doogle View Post
    What does Windows recognise the USB device as ?
    Hi ,
    it recognizes itself as a Human interface device (HID)...

  4. #4
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: How to read and write data through USB

    What is the module configured to do ? All the examples I can find are to do with Audio Output (eg USB Headphones / Speakers)

  5. #5
    Fanatic Member
    Join Date
    Sep 2009
    Location
    Lakewood, Colorado
    Posts
    621

    Re: How to read and write data through USB

    Are you sure this is the correct model number? The PCM 2707 USB is an Audio DAC with USB interface (it sould act like a sound card). I don't see anything that indicates that it provides a I2C interface. Internally, it has a SPI serial interface -- this is similar to I2C, but not the same thing, and I don't think it is designed to be used by the user.

    There are other devices (http://www.robotshop.com/devantech-u...m_campaign=jos) for example, that provide a USB to 12C interface. In the case of the one that I've mentioned, you would use MSComm to send and receive data, because it employs a device driver that emulates a serial adapter.

    Dick
    Richard Grier, Consultant, Hard & Software
    Microsoft MVP (Visual Basic)

  6. #6

    Thread Starter
    New Member
    Join Date
    Nov 2010
    Posts
    3

    Re: How to read and write data through USB

    Quote Originally Posted by Doogle View Post
    What is the module configured to do ? All the examples I can find are to do with Audio Output (eg USB Headphones / Speakers)
    Module is configured as the factory out , takes USB input and lets out I2S.

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: How to read and write data through USB

    you need some SDK or similar from the manufacturer
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  8. #8
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to read and write data through USB

    I think the O.P. means I²S, not I²C.

    I agree, the manufacturer's drivers and docs from an SDK would be the way to go.

  9. #9
    Fanatic Member
    Join Date
    Sep 2009
    Location
    Lakewood, Colorado
    Posts
    621

    Re: How to read and write data through USB

    Yeah, he did say I2S -- though this is about the same as I2C, with slight differences in protocol detail. However, since this is a HID device (and HID, normally, consists of mouse/keyboard IO, not sound card IO), it would seem that a vendor API is the way to go. I've seen other HID devices offer non-HID API's, though the ones that I've seen don't generally work under Windows Vista or Windows 7.

    I suppose that one more suggestion might be to look in Control Panel to see if the USB adapter not only appears as a HID device, but also as a sound device. If so, then standard sound APIs might be used, such as PlaySound in winmm.dll. I'm sure that I've seen a wrapper for this dll, though I don't have a quick link.

    Dick
    Richard Grier, Consultant, Hard & Software
    Microsoft MVP (Visual Basic)

Posting Permissions

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



Click Here to Expand Forum to Full Width