Dallas 2405 Switch

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Jon Chandler
Registered User
Registered User
Posts: 185
Joined: Mon Mar 10, 2008 8:20 am
Location: Seattle, WA USA
Contact:

Dallas 2405 Switch

Post by Jon Chandler » Mon Mar 10, 2008 8:24 am

Has anyone used the Dallas 2405 One Wire switch module successfully?

The examples to find switches find the one switch connected, but the example to toggle the switch fails. As far as I can tell, the toggle example never finds the switch....

Thanks for any comments!

Jon

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Mon Mar 10, 2008 10:43 am

This works for me

Code: Select all

Device = 18F452
Clock = 20

#option OW_PIN = PORTC.0
Include "DS2405.bas"

// find a switch...
If Find Then
   While true
      SwitchToggle
      DelayMS(500)
   Wend     
EndIf  
Wired up like the following

http://www.btinternet.com/~jon00/onewireintro.shtml

about half way down the page " Application - DS2405 used as a LED driver"

Jon Chandler
Registered User
Registered User
Posts: 185
Joined: Mon Mar 10, 2008 8:20 am
Location: Seattle, WA USA
Contact:

Post by Jon Chandler » Mon Mar 10, 2008 2:48 pm

I think I was too clever for my own good last night....

For a quick test and not having a 4.7k resistor handy, I thought "Ah ha. The I2C clock and data lines on my dev board have 4.7k pull-up resistors. I'll just change the pin designator and I'll be good to go." What I didn't consider in the middle of the night was that there's also an EPROM connected to those lines....oops.

Thanks for your reply David. I'll try again later today without the conflict!

Jon

Post Reply