This page is a wiki. Please login or create an account to begin editing.


9 posts / 0 new
Last post
Gary's picture
Offline
Joined: 2011 Jul 21
Using CodeWarrior to access the USB port

I have 3 devices that use the USB port for access:
1) a small endoscope (camera)
2) a credit card reader
3) an arduino with a custom app downloaded to it

I'd like to communicate with these devices via USB from my own (unwritten) app. I've used CodeWarrior for many years and written lots of stuff with it.

But I've never tried to access the USB port in any of those programs.

Please point me to some sample code that demonstrates how to do that. My preferred version of CodeWarrior is v6 Pro but I have many other versions available.

Gary

Comments

devils_advisor's picture
Offline
Joined: 2012 Jul 9

http://macintoshgarden.org/apps/apple-developer-connection-software-seed...

have a look at the apple resources for demonstration. this would be my first guess.

Gary's picture
Offline
Joined: 2011 Jul 21

Well as it turns out, accessing the USB port is anything but trivial. Unlike accessing a traditional serial port (done with a single call), USB requires that I write a driver.

Drivers are extremely mysterious beasties that require intimate knowledge of the device involved. And since I am not the manufacturer of any of the 3 units I mentioned, I'd guess that I would hit huge roadblocks if I pursued the task.

Thanks for looking.

Gary

devils_advisor's picture
Offline
Joined: 2012 Jul 9

i assume you have the drivers working for osx. do you have a machine that can run osx 10.0 ? you might be able to reverse the driver or analyze it. also from what i know there are tools available to get some output about usb and or firewire devices which could be useful. i wouldn't drop the project because you hit the first wall.

Gary's picture
Offline
Joined: 2011 Jul 21

>i assume you have the drivers working for osx

You assume incorrectly for 2 of the 3. The endoscope was billed as OSX compatible but it wasn't. The driver was supposedly "built in" but X says it can't find the driver.

The card reader was PC Only so I knew up front that I would have to develop my own software for it.

The Arduino has a fully functional OSX USB interface (for programming the unit) but I haven't yet looked for how to do the reverse (Arduino sending data back through the USB port).

Gary

devils_advisor's picture
Offline
Joined: 2012 Jul 9

http://arduino.cc/en/guide/macOSX <--- we talking about this ?
can you give me infos/links about the other 2 products ?
i try to find something

Gary's picture
Offline
Joined: 2011 Jul 21

Here is the link to the endoscope:
http://www.ebay.com/itm/361154363596?_trksid=p2059210.m2748.l2649&ssPage...

I have a little utility called "USB Probe" that adds the following information:
Manufacturer: Utron Technologies
Device: USB2.0 Camera

The card reader I bought about a year ago and don't have any more info on it. It is completely unmarked on the outside. And I can't find it right now.

I figured that the reader would show up as a keyboard but it didn't.

Your link to the Arduino site is correct. I have the UNO R3 board.

I also looked at your download. It appears to be a serial device driver of some sort. And the web page describes the driver as a pseudo USB serial port. This bears further investigation.

Thanks for the link.

Gary

devils_advisor's picture
Offline
Joined: 2012 Jul 9

http://www.ftdichip.com/Drivers/VCP/MacOS9/USBSerialConverter_040E2.sit.hqx

devils_advisor's picture
Offline
Joined: 2012 Jul 9

the camera might be a easy thing because you address it like a webcam. I'm looking for some source code to do just that. the card reader i think you could access it like the pcmcia bus on a powerbook g4 under os9 the difference is to address the usb bus. at least you would talk to the device. I'm looking for some source code.