Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 26, 2011, 08:48 PM   #1
unixperience
macrumors regular
 
Join Date: Jul 2010
usb com port number??

Hello, I am trying to program a microcontroller and have a usb to serial converter.
the program needs to know which usb port I'm using. all i could find was the device address
I've looked in the /dev folder for tty.usb or cu.usb but there is no usb listing in my /dev folder!!!
Any idea how I find out what port to use? here is the sample linux code if this helps anyone

avrdude -pm644p -P/dev/ttyUSB0 -cbutterfly -b57600 -u -U flash:w:Lesson1.hex -F


basically I need to change the ttyUSB0 to whatever port I am actually using, thanks for any help you can give
__________________
2008 Aluminum MacBook, 2.4GHz IC2D, 8GB ram, 64bit EFI 10.6.8, 500GB momentus 7200.4
unixperience is offline   0 Reply With Quote
Old Jan 27, 2011, 06:01 AM   #2
Guiyon
macrumors 6502a
 
Join Date: Mar 2008
Location: North Shore, MA
Have you installed the drivers for the USB adaptor?
__________________
Make life easier if you have a programming question!
http://www.sscce.org/
Guiyon is offline   0 Reply With Quote
Old Jan 27, 2011, 06:29 AM   #3
balamw
Moderator
 
balamw's Avatar
 
Join Date: Aug 2005
Location: New England, USA
Quote:
Originally Posted by Guiyon View Post
Have you installed the drivers for the USB adaptor?
Yeah, unfortunately there are no standard drivers for these beasts unlike mass storage or HID.

I recommend the Keyspan adapters http://www.tripplite.com/cables/usb-adapters-/en/3914 for their great support software around the drivers. Expensive, but they work.

B
__________________
MBA (13" 1.7 GHz 128GB), UMBP (15" SD 2.8 GHz), UMB (13" 2.4 GHz), iMac (17" Yonah), 32GB iPad 3 WiFi+LTE, 64 GB iPad WiFi, 32 GB iPhone 5, Airport Extreme
balamw is offline   0 Reply With Quote
Old Jan 27, 2011, 11:21 AM   #4
unixperience
Thread Starter
macrumors regular
 
Join Date: Jul 2010
the adapter I have is for a school project. It is supposed to work with mac, unfortunately everyone has just used windows for the project and can't quite remember how to get it to work with mac.

the adapter is for an amtel AVR device. if that helps anyone. I just can't download anything to my chip because I don't know how to identify the usb port I'm using
__________________
2008 Aluminum MacBook, 2.4GHz IC2D, 8GB ram, 64bit EFI 10.6.8, 500GB momentus 7200.4
unixperience is offline   0 Reply With Quote
Old Jan 27, 2011, 11:28 AM   #5
Guiyon
macrumors 6502a
 
Join Date: Mar 2008
Location: North Shore, MA
You need to figure out what controller chip the adapter is using and install the correct drivers for it. USB to serial adaptors will not work out of the box.

The most common ones are:
Prolific PL-2303
FTDI FT232R
Keyspan/Tripplite
__________________
Make life easier if you have a programming question!
http://www.sscce.org/
Guiyon is offline   0 Reply With Quote
Old Jan 27, 2011, 11:33 AM   #6
balamw
Moderator
 
balamw's Avatar
 
Join Date: Aug 2005
Location: New England, USA
Can you post a picture or any identifying marks from it?

B
__________________
MBA (13" 1.7 GHz 128GB), UMBP (15" SD 2.8 GHz), UMB (13" 2.4 GHz), iMac (17" Yonah), 32GB iPad 3 WiFi+LTE, 64 GB iPad WiFi, 32 GB iPhone 5, Airport Extreme
balamw is offline   0 Reply With Quote
Old Jan 27, 2011, 11:40 AM   #7
ulbador
macrumors 68000
 
ulbador's Avatar
 
Join Date: Feb 2010
Open up the System Profiler and see if the device actually shows up under the USB heading.

If it is actually working, it could be any number of devices:

/dev/usb/tts/0
/dev/tty.usbserial
/dev/tty.USBSERIAL
/dev/cu.BIGLONGDEVICENAME

The best way to check would just to unplug it, then plug it in and type in an already open terminal:

ls -alrt /dev/

If the device is actually working, then the relevant device or device folder will be towards the very bottom (and SHOULD have something to do with usb, tty or cu).
__________________
Mooooooooooooo
ulbador is offline   0 Reply With Quote
Old Jan 27, 2011, 11:54 AM   #8
Zortrium
macrumors 6502
 
Join Date: Jun 2003
This is a somewhat roundabout way, but I've found it much easier to use VMware to run a Linux VM in which to use my USB to serial converters than trying to get them to work in Mac OS X. Minimal setup and hassle, and some of the Mac serial drivers have a tendency to cause nasty kernel panics. YMMV.
Zortrium is offline   0 Reply With Quote
Old Jan 27, 2011, 12:05 PM   #9
MacTech68
macrumors 65816
 
Join Date: Mar 2008
Location: Australia, Perth
Open Apple System Profiler and checking the USB Product ID and Manufacturer ID's. Then you might be able to determine what chipset the adapter is and get a driver for that.

I have a Prolific USB to RS232 adapter (used in many older Nokia phone cables) that I use for my old Barcode Scanner.

Apple System Profiler gives me:

USB-Serial Controller:

Version: 3.00
Bus Power (mA): 500
Speed: Up to 12 Mb/sec
Manufacturer: Prolific Technology Inc.
Product ID: 0x2303
Vendor ID: 0x067b

Installing the kext "osx-pl2303.kext" (installed by the Prolific driver) gives me

tty.PL2303-3B1

in /dev

another driver that works with this adapter is a different kext name and a different tty in dev.
__________________
iBook14" 1.42Ghz, G4 DigitalAudio 733Mhz, iMac Snow 700Mhz, iBook SE 466Mhz, PowerBook Pismo 500Mhz, G3 B&W, G4 MDD 1.25Ghz, iMac 233 1998, iMac G4 USB2 1.25Ghz, iMac C2D 2.16Ghz, MacMini G4 1.25Ghz
MacTech68 is offline   0 Reply With Quote
Old Jan 27, 2011, 07:47 PM   #10
autorelease
macrumors regular
 
Join Date: Oct 2008
Location: Achewood, CA
[previous post redacted]

If you're using a USB programmer like an AVRISP mkII, all you need to do is say
Code:
avrdude -P usb ...
but I don't think that works when using a USB-to-serial cable.
__________________
*** -[NSAutoreleasePool autorelease]: Cannot autorelease an autorelease pool
autorelease is offline   0 Reply With Quote
Old Jan 31, 2011, 08:04 PM   #11
unixperience
Thread Starter
macrumors regular
 
Join Date: Jul 2010
Thanks for all the help. i found the device (it was in fact the FDTI FT232R) and using the alert command I found it was ttys000 or ttys001 depending on what usb i used(makes enough sense)

unfortunately though it says "programmer is not responding"

so thanks for your help thus far. if you want to take a swing at the new error, haha your more than welcome, but thanks to everyone for your help

ps i have the windows on a vm and bootcamp to do this project currently, i just hate windows and it said it works on mac... i just don't know how, so that's why i was trying
__________________
2008 Aluminum MacBook, 2.4GHz IC2D, 8GB ram, 64bit EFI 10.6.8, 500GB momentus 7200.4
unixperience is offline   0 Reply With Quote
Old Jan 31, 2011, 08:10 PM   #12
unixperience
Thread Starter
macrumors regular
 
Join Date: Jul 2010
actually I got it working!!!!

thanks again everyone!!!!

if anyone is interested, the alert command made about 5 changes when i plugged in the device(previously i used the most recent change to find the usb number)
this time i used the first change (tty.usbserial-A1000bB2) plugged that into my makefile and it worked fine. so the lesson is don't just check the very last file change
__________________
2008 Aluminum MacBook, 2.4GHz IC2D, 8GB ram, 64bit EFI 10.6.8, 500GB momentus 7200.4
unixperience is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
can a usb 3.0 port plug into 2.0 port JonDHayes iMac 4 Jan 28, 2014 10:50 AM
Multi-port usb hub that can charge devices from *each port* patrickkidd Community Discussion 3 Jul 22, 2013 11:40 PM
8 port USB 3.0 port for iMac AppleFan321 Mac Peripherals 1 Nov 21, 2012 03:48 PM
When Does My Phone Number Port? MacMonkey13 iPhone 11 Oct 20, 2012 10:59 AM
Can a Number Port Be Stopped? supervelous iPhone 2 Sep 15, 2012 10:53 PM

Forum Jump

All times are GMT -5. The time now is 04:18 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC