View previous topic :: View next topic |
Author |
Message |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
USB and RS232 PC Emulation |
Posted: Mon Aug 22, 2005 9:55 am |
|
|
I'm new about USB. I'm working with ex_usb_hid to understand how it work. W2K see the HID correctly. But I'm interest to create an virtual com to write directly with rs232 windows driver. I'm using PIC18F2455.
Were a have to work ?
Have you got an example of application ?
Is better to work with HID or Virtual Comport ?
Somebody help me,
Thanks, |
|
|
valemike Guest
|
|
Posted: Mon Aug 22, 2005 10:59 am |
|
|
The PICDEM USB FS i believe has a demo app that is an RS232 <--> USB converter. You should buy one; it's something like $60 (?) |
|
|
imbue
Joined: 28 May 2005 Posts: 13
|
|
Posted: Mon Aug 22, 2005 12:33 pm |
|
|
For a virtual com port you want a Communication Device Class (CDC). CCS has a driver, usb_cdc.h, and a couple examples, ex_usb_serial.c and ex_usb_serial2.c. |
|
|
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Thu Aug 25, 2005 2:07 am |
|
|
I saw in my PIC directory but I didn't found ex_usb_serial.c?
Please, can you tell me where I can get that examples and CDC class ?
Thanks Imbue |
|
|
imbue
Joined: 28 May 2005 Posts: 13
|
|
Posted: Thu Aug 25, 2005 12:07 pm |
|
|
CCS just recently added the CDC examples and drivers, maybe a month or so ago. Update to the latest version and it'll be in the same place you found ex_usb_hid. |
|
|
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Mon Aug 29, 2005 1:18 am |
|
|
OK !
I upgrade and I have now the example working. The sistem saw the insertion of new device but I haven't the driver for cdc under W2000.
Where I can get driver for cdc_class and especially "cdc_NTXP.inf"
Thanks for nice replay. |
|
|
imbue
Joined: 28 May 2005 Posts: 13
|
|
Posted: Mon Aug 29, 2005 2:32 am |
|
|
I am also missing the file. To get the examples working, I modified the inf file provided by microchip with their CDC code. All that needs to be changed is the PID & VID so it matches what is compiled. Here is the microchip inf file with the changes:
Quote: |
; Windows USB CDC ACM Setup File
; Copyright (c) 2000 Microsoft Corporation
; Copyright (C) 2004 Microchip Technology Inc.
[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MCHP%
LayoutFile=layout.inf
DriverVer=08/17/2001,5.1.2600.0
[Manufacturer]
%MFGNAME%=DeviceList
[DestinationDirs]
DefaultDestDir=12
[SourceDisksFiles]
[SourceDisksNames]
[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_0461&PID_0033
;------------------------------------------------------------------------------
; Windows 2000/XP Sections
;------------------------------------------------------------------------------
[DriverInstall.nt]
CopyFiles=DriverCopyFiles
AddReg=DriverInstall.nt.AddReg
[DriverCopyFiles]
usbser.sys,,,0x20
[DriverInstall.nt.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,usbser.sys
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
[DriverInstall.nt.Services]
AddService=usbser, 0x00000002, DriverService
[DriverService]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\usbser.sys
;------------------------------------------------------------------------------
; String Definitions
;------------------------------------------------------------------------------
[Strings]
MCHP="Microchip Technology Inc."
MFGNAME="Microchip Technology Inc."
DESCRIPTION="Communications Port"
SERVICE="USB RS-232 Emulation Driver"
|
Save that as anything.inf and it should work. |
|
|
Guest Guest
|
|
Posted: Sun Oct 09, 2005 5:45 pm |
|
|
I tried using your modified INF file technique by saving it as something like "ccs.inf". I plugged in my 18f USB hardware and my W2K box recognized the existence of a new USB device but with a yellow question mark. I then went into the properties for this USB device in the Windows Hardware Manager and tried to reinstall the driver and select this new "ccs.inf" as the INF file. Windows came back to me and said that it found the pre-existing driver, "usb.inf" I believe, and wanted to use it instead. Windows does not allow me to overide and say "No, use the ccs.inf file instead!". Any suggestions? |
|
|
|