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 support@ccsinfo.com

USB on Windows 98 SE

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
James E. Hewson



Joined: 16 Jul 2010
Posts: 3

View user's profile Send private message

USB on Windows 98 SE
PostPosted: Fri Jul 16, 2010 2:53 pm     Reply with quote

Hello,

I have created an embedded device that uses the PIC18F2550. The device includes the CCS USB stack and enumerates as a composite HID Keyboard and HID Compliant Device (both at the same time). Everything works great under Windows 2000, XP and 7.

However, under Windows 98 SE there is a problem. When I plug the USB cable into the device it enumerates correctly (using the native Windows 98 SE drivers) and the HID Keyboard and HID Compliant Device work as expected. But when I unplug the USB cable from the device, Windows 98 SE hangs (that is, msgsrv32.exe hangs) and I have to re-boot the PC.

I have seen the same behavior on four different Windows 98 SE PCs.

How do I resolve this issue and get my device working correctly under Windows 98 SE (and still have it work under Windows 2000, XP and 7)?

Thanks,
James.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Jul 16, 2010 3:05 pm     Reply with quote

I don't think, that it's a device side problem. These things happen, when the USB cable is unplugged before the PC application connected to the USB device closes the connection and the application doesn't implement a suitable timeout. I remember, that a similar issue exists e.g. with Win98 Hyperterminal and virtual COM port.
James E. Hewson



Joined: 16 Jul 2010
Posts: 3

View user's profile Send private message

PostPosted: Fri Jul 16, 2010 3:15 pm     Reply with quote

Thanks for the response.

Please keep in mind that there is no "PC application" in this situation. Since the embedded device is an HID Keyboard, the built-in Windows 98 drivers are handling everything.

Also, I have a commercial USB Keyboard that works correctly when plugged in or unplugged from the same Windows 98 PC. As it turns out, the commercial USB Keyboard also enumerates as both an HID Keyboard and an HID Compliant Device (just like my embedded device), so it's a pretty close approximation to what I am attempting to do--and it works!

Thanks,
James.
James E. Hewson



Joined: 16 Jul 2010
Posts: 3

View user's profile Send private message

PostPosted: Fri Jul 23, 2010 5:17 pm     Reply with quote

Problem solved!

With the excellent help of Darren Rook (CCS), this problem has been solved. Here's the deal...

My code was completely ignoring any data that came back from the PC to the HID Keyboard (e.g., the LED status data). That is, I was never calling the usb_get_packet() function to clear the incoming buffer. Apparently Windows 2000/XP/7 are okay with that situation. However, Windows 98 is not okay with that situation. It appears that Windows 98 was sending data to the HID Keyboard and hanging up while waiting for the data to be properly read by the HID Keyboard. Since my HID Keyboard was not "properly" reading the data, Windows 98 was getting messed up.

Thanks to all for you helpful 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