Realtime serial port HAL?

More
12 Mar 2011 20:10 #7757 by sam0737
I would like to create a realtime hal component that call work with serial port. (Ya much like what parport does...)

Don't worry abou telling me the speed of serial port...I am not controlling XYZ-bot over it, but instead I am running a extruder on it. 200 calls/sec is good enough. In fact, I am building a repstrap, and I have a python userspace hal component working, but the jitter is - bad, that's why I want to convert it to realtime component.

The issue is - how could I access the serial port hardware? AFAIK it's supported in RTAI but I have no idea how to load the module, and which header file to reference, etc. Pointers are very much appreciated!

Please Log in or Create an account to join the conversation.

More
12 Mar 2011 20:55 #7758 by andypugh
There is already a HAL module to access the serial port, but it does it on a raw pin basis
www.linuxcnc.org/docview/html/man/man9/serport.9.html

However, you might be able to modify the code to do what you want.

The source file is src/hal/drivers/serport.comp and it is written in the "comp" preprocessing language:
linuxcnc.org/docs/html/hal_comp.html

Please Log in or Create an account to join the conversation.

More
13 Mar 2011 01:12 #7771 by sam0737
Wow. Looks like serport comp is flipping the register of 8250 and 16550 type serial port...

However, I am using USB serial port...Just wonder if I can get a byte stream interface out of it...

Please Log in or Create an account to join the conversation.

More
13 Mar 2011 09:44 #7776 by andypugh
sam0737 wrote:

I am using USB serial port...Just wonder if I can get a byte stream interface out of it...


Possibly, but not in Realtime. The problem is not the USB-to-Serial but the actual USB protocol itself. USB is (currently) not usable with realtime.

Somebody tried to fix this and wrote a realtime USB driver for RTAI.
www.rtai.org/RTAICONTRIB/
But it doesn't currently work with the newer kernels (if it ever worked, I have my doubts)

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum