Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Serial port access...

Serial port access...
Thread Tools
tennesseekevin
Fresh-Faced Recruit
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 3, 2003, 12:26 PM
 
Salut everyone,
I really, really want to play with motor control and other such hardware using my Powerbook; however, I'm finding it nigh on impossible to figure out how to go about doing it. I'll obviously need a keyspan serial adapter, but from the software/programming end of things I have no idea where to get started. I've looked through the IOKit documentation, and from what little of it I can understand, I've gathered that the simple act of turning on an LED through the serial port is not so simple. While having a protected kernel space is wonderful, I do envy the VB guys who can just open a serial port. Anybody have any ideas on what direction I should be going in to try to gain serial port control? It's my understanding that realbasic will do serial stuff. I know it doesn't enforce good coding habits, but the IOkit seems like overkill for what I want to do.

Cheers,
Kevin
     
skipjack
Dedicated MacNNer
Join Date: Oct 2000
Status: Offline
Reply With Quote
Nov 3, 2003, 05:35 PM
 
Originally posted by tennesseekevin:
Anybody have any ideas on what direction I should be going in to try to gain serial port control?
Look at a program called MacWise (www.carnation-software.com). I'm not saying this is the best solution since I'm not very experienced with controlling serial ports, but running a program like this is the only way I know of to get easy serial port communications.
     
Octo
Junior Member
Join Date: Aug 2000
Location: Montreal, QC, Canada
Status: Offline
Reply With Quote
Nov 3, 2003, 10:08 PM
 
Checkout http://www.harmless.de/cocoa.html

He has some serial port classes which are quite easy to use and they are freely available. I've added them to my application without having to spend anytime in the IOKit.

Can I ask how you are driving the motors from the serial port? Direct or do you have a controller of some sort?
     
aleph_null
Dedicated MacNNer
Join Date: Jan 2001
Location: Boulder, CO, USA
Status: Offline
Reply With Quote
Nov 3, 2003, 11:46 PM
 
Er. I had to do this a while back. Gotta dive into the IOKit and termios stuff. Ick. Termios was the painful part. The IOKit wasn't so bad, actually.

I was getting *paid* to do it, of course, so that was a good motivator. If you can find a library or framework that does what you need, go for it.
     
tennesseekevin  (op)
Fresh-Faced Recruit
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 10, 2003, 12:10 AM
 
With a Google search for Keyspan (the serial adapter I'm using) and termios I came across a posting to pyserial. It's a python extension that provides access to posix commands. If anyone is interested in relatively easy, free port control, check out pyserial.

In regards to Octo's question about control of the motors, I'll probably use an integrated H-bridge to actually power the motors and send the H-bridge the signals from the port.

Cheers,
Kevin
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:49 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,