none
USB port programming in C RRS feed

  • Question

  • Hello,

    I have a board with a PIC18 microcontroller on it. The microcontroller has the facility to communicate on USB with the PC and I must use this facility because I have a great amount of data to send to the PC. On my PC, with Windows 7 and Visual C++2003 installed, I'd only used serial RS232 communication by now. I'd need a guidance to solve this problem.

    M.P.


    Misu

    Wednesday, October 1, 2014 12:11 PM

Answers

  • This , this and other websites offer professional help for many kinds of programmer work. 

    Very useful for beginners to quickly get their projects up and going. 

    -- pa

    Wednesday, October 1, 2014 6:52 PM

All replies

  • the regular C open call from Win32 can open COM1 to COM9 

    check to see if the board is below COM9 in the device manager, if its not, change it to 9 or lower

    OpenFile() is then all you need

    http://msdn.microsoft.com/en-ca/library/windows/desktop/aa364232(v=vs.85).aspx

    I included the manual for the Win32 API file system generally for you convenience



    MSFT Signature

    Place your rig specifics into your signature like I have, makes it 100x easier!

    Hardcore Games Legendary is the Only Way to Play!
    Vegan Advocate How can you be an environmentalist and still eat meat?

    Wednesday, October 1, 2014 12:16 PM
  • This , this and other websites offer professional help for many kinds of programmer work. 

    Very useful for beginners to quickly get their projects up and going. 

    -- pa

    Wednesday, October 1, 2014 6:52 PM
  •   Thank you but I've already made communications on emulated COM ports in C++ using RS232 protocol. The speed on my microcontroller is limited at 112kB/sec. I need to make communications at a speed higher than 1Mb/sec and for that I must use USB port and another protocol.


    Misu

    Thursday, October 2, 2014 9:32 AM