On Tue, Feb 16, 2010 at 12:55:00AM -0800, Klemen Dovrtel wrote:
> Would it be possible to make/compile hal modules for standard
> communication protocols like i2c, 1wire, uart,... For instance, I
> would like to connect a 1wire temperature sensor directly to parallel
> port for monitoring/control the temperature of machine/process. Has
> anybody tried this?

It depends whether the protocol will work within the constraints of HAL.
Here, the timing constraints are probably most relevant: each
base-period you can sample an input once and change an output once.
Each period is displaced from its ideal time by up jitter, which in many
cases is nearly half as long as the period.

So bit-banging rs232-style serial is not likely to work well, unless the
rate is much less than 1 bit per base-period.

i2c master, spi master are going to work much better, since you'll
generate the clock at the same times you generate and read the signal.
Top rate: 1 bit per 2 base-periods.

1wire is nice and slow, so you should typically have enough base-periods
available to determine what bit is being transmitted by the slave.  Top
rate: determined by 1wire

In the case of i2c and 1wire you'll have to deal with the requirement
for open collector lines.  You can do this using one I and one O pin and
some external circuitry, of course.   Some parports have the ability to
treat the the "control port" pins (1, 14, 16, 17) as OC, but we removed
this capability from our own parport driver because it was a frequent
cause of misconfiguration.  In case you want to go looking in our
project's history, this capability was removed in commit 66639eacc4
(unfortunately, the hal_parport driver has changed enough in the
meantime that the commit can't just be reverted)

If you do write any of these hal components, please consider sharing
them with the community.  We have a wiki page for this purpose:
    http://wiki.linuxcnc.org/emcinfo.pl?ContributedComponents
to edit the wiki, you first have to log in with a specific password
(this is to stop, or at least slow down, wiki spammers):
    http://wiki.linuxcnc.org/emcinfo.pl?BasicSteps

Jeff

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to