Friday, March 13, 2009

/dev/cu vs /dev/tty ( osx serial ports)

A while ago someone told me to use /dev/cu.usbserial rather than /dev/tty.usbserial as the former did not require hardware handshaking. I was looking for this justification again as my memory had gone a little hazey on the exact reason for using cu over tty. I found the following at http://lists.berlios.de/pipermail/gpsd-dev/2005-April/001288.html. Thought it a good thing to know and thought I'd remember it here for next time.

"The idea is to supplement software in sharing a line between incoming and outgoing calls. The callin device (typically /dev/tty*) is used for incoming traffic. Any process trying to open it blocks within the open() call as long as DCD is not asserted by hardware (i.e. as long as the modem doesn't have a carrier). During this, the callout device (typically /dev/cu* -- cu stands for "calling unit") can be freely used. Opening /dev/cu* doesn't require DCD to be asserted and
succeeds immediately. Once succeeded, the blocked open() on the callin device will be suspended, and cannot even complete when DCD is raised, until the cu device is closed again.

That way, you can have a getty listening on /dev/tty*, and can still use /dev/cu* without restrictions."


So this is what I use when programming with AVRDude as the butterfly doesn't have any DCD/DTR lines to assert. Its just TX, RX, and GND. If you have problems on the mac using a tty serial port you should try its cu equivalent.

Monday, March 09, 2009

GEDA portfiles

Now I've got kicad building again ( although rather bloated at 20Mb ) I thought I'd have a play with some other items on my todo list. I've manage to get most of the GEDA suite working on the mac and have created portfiles for mac ports to be able to install them. I haven't got gwave to work yet due to some dependances and some of the installs needed to be forced to overwrite some other files but in general they seem to work. I hope to add kicad as a port file in the near future but I will see if I can get these programs to work first.

In doing this I noticed a few messages regarding others trying to get port files up for gEDA on the mac so I assume they will make it into the main ports tree at some time in the near future.

To use my files you can browse them at http://www.brokentoaster.com/macports/ or download them all at http://www.brokentoaster.com/macports/ports.zip.

First you will need to extract the files into a local directory such as /users/me/ports. Then you will need to add /users/me/ports to the /opt/local/etc/macports/sources.conf file. The last action is to run the command portindex from your newly created ports directory to ensure the index is up to date.

If these are of any use to you then enjoy. Good luck.