1-line digital thermometer DS18B20 to LinuxCNC

More
23 May 2013 22:06 #34589 by Blackwind
Hi Folks,
One simple question: someone hookup a DS18B20 style temperature sensor (one line comms), to a pin in LCNC?
It could be done?
a specs sheet can fe found here:
DS18B20 Datasheet

Regards
Rick

PS: to moderators, move this topic if is needed.

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

More
23 May 2013 22:27 #34590 by andypugh

One simple question: someone hookup a DS18B20 style temperature sensor (one line comms), to a pin in LCNC?



I can't find any references to doing so on the Wiki. However it looks like something that could be relatively easily done in software on the parallel port.
To guarantee < 15uS pulses the software would need to have a "reset" function as used by the parallel port driver, but other than that it looks moderately straightforward so write a HAL module to do it.
en.wikipedia.org/wiki/1-Wire
The following user(s) said Thank You: Blackwind

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

More
28 May 2013 20:29 - 28 May 2013 20:30 #34835 by Blackwind
Hi, andy, thanks for the reply
I have assumed that I had to write hal module to do it, and it seems simple, but thats beyond my current programming skills.
There is some arduino code and libraries for one wire, thats more familiar to me, but has to be ported.
Posted this asking if someone have this 1-wire sorted out, i think is interesting if we could have it.
Regards
Rick
Last edit: 28 May 2013 20:30 by Blackwind.

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

More
28 May 2013 20:39 #34837 by andypugh

I have assumed that I had to write hal module to do it, and it seems simple, but thats beyond my current programming skills.

It sounds like fun, so I just ordered a few temperature sensors to play with.
The following user(s) said Thank You: Blackwind

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

More
28 May 2013 20:59 #34842 by Blackwind

I have assumed that I had to write hal module to do it, and it seems simple, but thats beyond my current programming skills.

It sounds like fun, so I just ordered a few temperature sensors to play with.


:woohoo: Pure human enlightenment, im with you.

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

More
31 May 2013 03:45 #34994 by andypugh
It looks like there would need to be external hardware, unless you happen to have an open-collector parallel port (bidirectional pins).
www.maximintegrated.com/app-notes/index.mvp/id/3230
Shows a scheme for 2-wire devices which can probably be modified.

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

More
07 Jun 2013 19:47 #35401 by Blackwind
Im confused
correct me if im wrong, pins 1-14-16-17 are always out, 10-11-12-13-15 are always in, but 2 to 9, can be in/out pins, this is an pp specification?

www.linuxcnc.org/docs/2.4/html/hal_parallel_port.html

but this has to be defined when loading a pp driver trough hal, this is the limitation? again, my lack of programming skills baffles me.

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

More
07 Jun 2013 20:06 #35403 by BigJohnT
Yes, you load the parallel port driver as IN or OUT when you start the configuration.

JT
The following user(s) said Thank You: Blackwind

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

More
07 Jun 2013 20:31 #35406 by andypugh

but 2 to 9, can be in/out pins, this is an pp specification?


It might be possible to use the pins as in/out in the semi-undocumented "X" mode. But I don't think that creates both sets of HAL pins. (and is only safe with certain models of parallel port)
www.linuxcnc.org/docs/html/hal/parallel_port.html

The problem is that one-wire needs to both be able to drive a pin low to signal to the devices, and set the pin high then read the value back to see if they are pulling it low.

One-wire might be possible with a single pin with changes to X-mode in the parport driver, but only for some parallel ports.
The following user(s) said Thank You: Blackwind

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

More
07 Jun 2013 20:47 #35407 by Blackwind
have not read that section 1 note "hal and oc", my toughts blinding my vision....
Nice way to find what type of hardware is in pp.
Regards
Rick

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

Time to create page: 0.089 seconds
Powered by Kunena Forum