CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

USB and RS232 PC Emulation

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

USB and RS232 PC Emulation
PostPosted: Mon Aug 22, 2005 9:55 am     Reply with quote

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







PostPosted: Mon Aug 22, 2005 10:59 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Aug 22, 2005 12:33 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 25, 2005 2:07 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 25, 2005 12:07 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Aug 29, 2005 1:18 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Aug 29, 2005 2:32 am     Reply with quote

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







PostPosted: Sun Oct 09, 2005 5:45 pm     Reply with quote

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?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group