1-wire
Lars50
Posts: 23
I'm using·DS 2405, a couple of them for a relay control. How do I check the status of the switch when starting up the prgrm.
OWOUT OWpin, OW_FERst, [noparse][[/noparse]$F0, STR Switch1\8]········································ 'point at a specific device·
OWIN OWpin, OW_BitMode + OW_BERst, [noparse][[/noparse]status]········································· ' read status ??
IF (status = 1) THEN· OWOUT OWpin, OW_FERst , [noparse][[/noparse]MatchROM, STR Switch1\8]· ' toggle switch if =1
It seems that I get 0 and 1 every other time when I really shoul see 0 every time.
Lars
OWOUT OWpin, OW_FERst, [noparse][[/noparse]$F0, STR Switch1\8]········································ 'point at a specific device·
OWIN OWpin, OW_BitMode + OW_BERst, [noparse][[/noparse]status]········································· ' read status ??
IF (status = 1) THEN· OWOUT OWpin, OW_FERst , [noparse][[/noparse]MatchROM, STR Switch1\8]· ' toggle switch if =1
It seems that I get 0 and 1 every other time when I really shoul see 0 every time.
Lars
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
I run this as the first couple of line, to set them all as 0. This works one time and then when restarting again I get 1 and then 0 etc.
The Search_rom should not toggle the switch, whilst Match_rom does, or?
Lars
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
What's missing is how to detect the "status". Is that done the way I tried or should it be done by using the Active-Only Search ROM $EC, this should only pick out those which is low, but I guess I would need some support on the code here.
Lars
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
It must be diffrent way of doing this. Let's see if some of the other guys has an advise here.
Lars
Or even the DS2408 which has 8 outputs...
I beg to differ. Yes he should toss those DS2405s. The company only makes them for replacement value. That is to replace used ones in contracts that actually made the mistake of ordering them. The proper one is the DS2406. The DS2407 may not even be made anymore.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Buck Rogers
www.gregg.levine.name
I got two similar suggestions to move away from the 2405 that I got for free from Dallas. Why should I go and buy two new 2406. Just kidding, what is the main difference with the 2406 except for the·double switches. Why is it better??
Lars
Lots of reasons. The TO-92 package for the DS2406 has only one switch. The TSOC version is the double.
Also the DS2405 is not well thought of now, by the folks at the company, and by alumuni. Also by technolgy users, such as myself.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Buck Rogers
www.gregg.levine.name
I vent through the datasheet and felt it is well above me knowledge, for the 2405 I could always find bit and pieces of code that I can put together to a working system. As you understand I'm not pro only a happy newbie.
I could see myself using a TO package to keep my PCB unchanged. i.e still one channel.
Any hint how to find a piece of code or hint·for the 2406 is appreciated.
Again, thank for your advice.
Lars
Thanks