Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

unixperience

macrumors regular
Original poster
Jul 21, 2010
235
5
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
 

unixperience

macrumors regular
Original poster
Jul 21, 2010
235
5
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
 

ulbador

macrumors 68000
Feb 11, 2010
1,554
0
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).
 

Zortrium

macrumors 6502
Jun 23, 2003
461
0
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.
 

MacTech68

macrumors 68020
Mar 16, 2008
2,393
209
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.
 

autorelease

macrumors regular
Oct 13, 2008
144
0
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.
 

unixperience

macrumors regular
Original poster
Jul 21, 2010
235
5
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
 

unixperience

macrumors regular
Original poster
Jul 21, 2010
235
5
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.