Sonsivri

Electronics => Pic C Languages => Topic started by: xane on January 10, 2008, 09:25:43 09:25



Title: USB Driver for PIC18F4550
Post by: xane on January 10, 2008, 09:25:43 09:25
Hi,

I am looking for some tutorials/help on writing USB device driver for PIC18F4550 based board.

The tools I prefer is VB6, C#, VB.net

If someone knows the links would be helpfull for me

regards

xane



Title: Re: USB Driver for PIC18F4550
Post by: lyk on January 10, 2008, 10:44:06 10:44
Look on http://www.microchip.com


Title: Re: USB Driver for PIC18F4550
Post by: memed500 on January 10, 2008, 11:58:36 11:58
http://www.create.ucsb.edu/~dano/CUI/
http://www.microchipc.com/sourcecode/


Title: Re: USB Driver for PIC18F4550
Post by: setoy on January 10, 2008, 12:03:40 12:03
IMHO, writing your driver (in VB!) if you haven't any experience with writing drivers is senseless and too heavy. On http://www.microchip.com you will find nothing, look on microsoft -> MSDN -> DDK. But better way, use someone of microchip otr CCS drivers or libusb (open source USB driver)


Title: Re: USB Driver for PIC18F4550
Post by: J1M on January 10, 2008, 02:22:31 14:22
Hi there, here you have articles that I´ve published on my webpage:

- PicWinUSB: PIC18F2550 USB Example with CCS, VC#, WinUSB, Win Vista & XP (x64 and x86 versions)
http://www.hobbypic.com/index.php?option=com_content&task=view&id=31&Itemid=1&lang=en

- PicUSB: PIC18F2550 USB Example with CCS, VC#, MCHPUSBAPI, Win XP & 98
http://www.hobbypic.com/index.php?option=com_content&task=view&id=14&Itemid=27&lang=en

- PicUSBNut: PIC18F2550 USB Example with CCS, VC#, MCHPUSBAPI, Win XP & 98
http://www.hobbypic.com/index.php?option=com_content&task=view&id=23&Itemid=27&lang=en

- PicUSB Stuff: PIC18F2550 USB Example with CCS, VC++, VB, Delphi, Labview and Linux, MCHPUSBAPI
http://www.hobbypic.com/index.php?option=com_content&task=view&id=24&Itemid=1&lang=en


Best regards


Title: Re: USB Driver for PIC18F4550
Post by: xane on January 11, 2008, 05:48:52 05:48
IMHO, writing your driver (in VB!) if you haven't any experience with writing drivers is senseless and too heavy. On http://www.microchip.com you will find nothing, look on microsoft -> MSDN -> DDK. But better way, use someone of microchip otr CCS drivers or libusb (open source USB driver)
Hi I am not quite looking to write a driver (in vb or ..) from scratch, rather I am looking for generic (USB-Serial kind of) code/driver in which i can change PID/VID to identify my own device then use simple data transfer like serial port.


Title: Re: USB Driver for PIC18F4550
Post by: setoy on January 11, 2008, 12:56:14 12:56
It's different :) In this case I really  recommend you libusb. http://libusb.sourceforge.net/. It's simple, cross-platform and stable universal driver


Title: Re: USB Driver for PIC18F4550
Post by: shibuv on January 14, 2008, 09:28:37 09:28
See this one

http://electronicfr.com/index.php/Microcontrollers-and-USB/Part-1-How-to-build-a-USB-device-with-a-PIC-18F4550-or-18F2550.html


Title: Re: USB Driver for PIC18F4550
Post by: fb2007 on January 15, 2008, 11:14:11 11:14
Hi, after some "tries and errors" i used the following components to have a working USB-communication between a PIC18F4550 and my PC:
- MikroC for the PIC
- HIDLIBRARY.DLL from Mike Obrian
- Visual Studio 2005

i had to fight a little bit with the documentation... but in the end the following code did the trick:
- Exchange data with my USB device:

Private Sub ReadInternalADC()

        Dim InputData As HIDLibrary.HidDeviceData
        Dim i As Integer
        Dim OutputText As String
        Dim uInput As Integer


        '--> Enumerate the devices with the Vendor Id
        '--> and Product Id of the DDS Stuff
        HidDeviceList = HIDLibrary.HidDevices.Enumerate(&H1235, &H1)

        If HidDeviceList.Length > 0 Then

            HidDevice = HidDeviceList(0)

            '--> Check if connected...

            HidDevice.OpenDevice()

            Dim OutData As Byte()

            ReDim OutData(HidDevice.Capabilities.OutputReportByteLength - 1)


            '--> Send a report to Device (8888888 is command to PIC to answer with data..)

            OutData(1) = Asc("8")
            OutData(2) = Asc("8")
            OutData(3) = Asc("8")
            OutData(4) = Asc("8")
            OutData(5) = Asc("8")
            OutData(6) = Asc("8")
            OutData(7) = Asc("8")
            OutData(8) = Asc("8")

            HidDevice.Write(OutData)
            InputData = HidDevice.Read
            OutputText = ""

            For i = 1 To 5
                OutputText = OutputText + Chr(InputData.Data(i))
            Next

            uInput = Int((Val(OutputText) * 4.7 / 1.024) + 0.5)    ' convert Text answer (ADC) to Voltage

        End If

    End Sub

have fun!


Title: Re: USB Driver for PIC18F4550
Post by: iphone on January 16, 2008, 04:00:58 16:00
can you share the complete code (schematic, mikroC source, hex and VC code )?

Thks


Title: Re: USB Driver for PIC18F4550
Post by: kathir on January 19, 2008, 01:02:06 01:02
Ihave developped with toools easyhid ,delphi
if u want mail me i will give all 


Title: Re: USB Driver for PIC18F4550
Post by: mnasabir on January 19, 2008, 10:38:23 10:38
best source known to me , downloads master's conference 2007 CD from this site and read tutorial in it


Title: Re: USB Driver for PIC18F4550
Post by: iphone on January 21, 2008, 03:46:51 15:46
if u want mail me i will give all 

Yes, please share it over here, so anybody would be benefit !!! ... thanks for your kindness
my email ... [email protected].

Thanks mate.


Title: Re: USB Driver for PIC18F4550
Post by: incubus22 on January 22, 2008, 04:49:55 04:49
Please also mail me your files. My email address: [email protected]

Thanks in advance!


Title: Re: USB Driver for PIC18F4550
Post by: BRANCA on January 24, 2008, 10:51:00 10:51
Please also mail me your files. My email address:[email protected]
Thanks in advance!


Title: Re: USB Driver for PIC18F4550
Post by: actionstk on January 26, 2008, 12:31:17 12:31
Thanks in advance!


Title: Re: USB Driver for PIC18F4550
Post by: strolch on February 08, 2008, 04:43:10 16:43
I could send you the Source code of the PDFSUSB.exe. It a good bootloader and aplication Software from Microchip.
It's written in C++ 6.0 from Borland!

Greetings


Title: Re: USB Driver for PIC18F4550
Post by: mabd on February 15, 2008, 04:45:51 16:45
microchip forum the usb section contains a lot of usefull material

Posted on: February 15, 2008, 08:40:08 08:40 - Automerged

here is the link

http://forum.microchip.com/tt.aspx?forumid=102

xiaofan and DarioG are good contributors


Title: Re: USB Driver for PIC18F4550
Post by: ata_tr on February 20, 2008, 10:30:38 10:30
I tried so much, but I could not manage to get my 18F2550 work properly.  :-\


Title: Re: USB Driver for PIC18F4550
Post by: setoy on February 20, 2008, 03:42:12 15:42
... and what exactly tried??