News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

port programming

Started by anuradha, March 12, 2007, 10:55:38 PM

Previous topic - Next topic

anuradha

hi
Is their any way of programming USB prots

BBalazs

I am searching for the same thing.
As I revealed, the HID is the only reasonable solution for us, mortals....because there is no need to write an extra driver, you can use windows own.

What do you want to use by this port? Because the other side of the USB is also important...e.g. a microcontroller or so.

ossama

i am searching for usb demo program that communicate with a self made device (for example light on and off a LED connected to USB port of the PC)

bozo

i'd say you'd have to develop a USB driver for this, unless you were to communicate with the driver itself.
there may be samples in the DDK

redskull

Generally speaking, the deal with USB is that you don't need a driver, you need an INTELLIGENT PERIPHERAL on the other end.  That is, whatever you intend on plugging into the port has to have its own USB-compatible circuity.  In practical terms, you (almost) need a full-fledged, full-featured, USB controller on your device, even if its just an LED.  Remember, every USB device shares the common bus (even if you have separate plugs), so you can't just go lighting up pins willy-nilly; everyone has to use defined messages and formats so data for your webcam doesn't go to your ipod.  It's a lot more like Ethernet than it is RS-232.

-ac
Strange women, lying in ponds, distributing swords, is no basis for a system of government

zooba

Nice answer, redskull. I'm going to bookmark this so when the next person asks I can redirect them here  :bg

Cheers,

Zooba :U

Mark Jones

I'm leaning toward's Kernel's comment. Windows has a lot of USB device drivers in its cabinets, however every USB device I have connected has always required some kind of driver. (That is not to say that the device itself does not require special design considerations -- it does also.)

Microchip brand offers chips like the PIC18F4553, a higher-end, battery-powerable/8-bit/12 MIPS/40-pin/12MBit USB-onboard microcontroller which seems like a nice choice to prototype with since it has a lot of features yet is a simpler topology. Microchip also has a USB Application Design page with lots of help. Under their Software/Tools section there is a USB driver framework (32MB download.) It would be interesting to see if someone could come up with an assembler-based version of the driver. (100kB vs 32MB?) :toothy
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

redskull

While I agree that many different circumstances call for special drivers, 99% of all hobbyist devices can be implemented with the HID device class without a stitch of MASM code.  Basically, if you have to ask if you need a driver, then you probably don't (assuming you design the device right).  Moreover, if you *do* need a custom driver, then you are probably working on a high-enough level not to be posting on internet forums in the first place.

-ac
Strange women, lying in ponds, distributing swords, is no basis for a system of government

Mark Jones

So... did you just imply that internet forums (such as this) are low-life hang-outs? :lol

I believe the majority of commercial USB devices use custom drivers because either their application requires them (USB video capture, keyboard, etc.) and/or proprietary reasons (we are company X and we are going to do it our way, screw any easy standards...) But I agree, for the vast majority of "hobbyist" devices, the simple HID driver should be adequate for blinking lights, etc. (How many different ways could there be to stream standardized serial data over a standardized link? ... Wait, forget I mentioned it.)

However when the developer needs to say, crunch 10MB/s of measurement data from the USB device into the parallel port (within a very specific timing window), then a simple driver will be needed. So why download and wade through heaps of abstraction in a 32MB "C" driver package, if a concise 100kB assembler package would work instead? Granted, assembler would not be the optimal choice in many scenarios, but I can't imagine why having additional choices would be a bad thing.

Or are we afraid the "script kiddies" will steal the code and start writing malicious USB drivers? ::) :lol
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

kromag

There are frameworks that you can already load a simple demo into an IDE like VS EE and then show the Assembler output.
DDK, WDDK, KDMF et cetera, are just a few frameworks.

With all that I wouldn't worry about script-kiddies as you put it. With a little will they could just go to http://rootkit.com

Most of the kits you will find however are going to be implemented in 'C'.
---
Kromag.


Vortex

Off topic, Microsoft's devcon tool seems to be able to load motherboard USB drivers. The DDK or the WDDK must have the C source code of this tool.

redskull

Quote from: Mark Jones on December 15, 2008, 07:33:36 PMSo... did you just imply that internet forums (such as this) are low-life hang-outs? :lol

I suppose my membership means there's at least one low life hanging out here  :bg
Strange women, lying in ponds, distributing swords, is no basis for a system of government