Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/18/05 12:19
Read: times


 
#85184 - Lets try again
Responding to: ???'s previous message
This is my standard working 1Wire (Dallas network) – Working – system
1. sbit ibutton_io = 0xA0; //P2.0

This is the 1Wire reset function:
2.
// ***************************************************************************
// OW_RESET
// Function description:
// Performs a reset on the one-wire bus and returns the presence detect.
// Reset is 480us, so delay value is (480-24)/16 = 28.5 - we use 29.
// Presence 70us later, so delay is (70-24)/16 = 2.875 - we use 3.
// Return value: (Char) 1 = Presence, 0 = no part
// ***************************************************************************
unsigned char Ow_Reset(void)
{
ibutton_io = LOW; // pull 1_Wire line low
uDelay(29); // leave it low for 488us
ibutton_io = HIGH; // allow line to return high
uDelay(3); // wait for presence 72us

if(ibutton_io) // if line is high
return 0; // no part presence
else
{ // get presence signal
while(!ibutton_io); // wait for end of timeslot
return 1; // 1 = Presence, 0 = no part
}
}

ibutton_io (0xA0 – P2.0) is used to communicate with the 1Wire devices.
In this arrangement you can have many devices all connected to a “single”
1Wire network.
I want three(3) different networks, running to three(3) different locations and be able to detect not only the device, but also the network it is connected to.
Hence I need to dynamically allocate “ button_io “ to P2.0 or P2.2 or P2.4



List of 24 messages in thread
TopicAuthorDate
sbit            01/01/70 00:00      
   I do not understand            01/01/70 00:00      
      You mean Dallas 1-Wire?            01/01/70 00:00      
   Re            01/01/70 00:00      
   What's the problem?            01/01/70 00:00      
      I think that...            01/01/70 00:00      
         indirect bit addressing            01/01/70 00:00      
         The same iButton on all 3?            01/01/70 00:00      
         sbit            01/01/70 00:00      
            access all 3 , one at a time            01/01/70 00:00      
   I had the same problem            01/01/70 00:00      
      Lets try again            01/01/70 00:00      
         Need ?            01/01/70 00:00      
         Why?            01/01/70 00:00      
         There is always the switch statement            01/01/70 00:00      
            something like this...            01/01/70 00:00      
         Simultaneous example            01/01/70 00:00      
            Use MASK rather than bit address            01/01/70 00:00      
               Oooops, sorry...            01/01/70 00:00      
      Multiple 1Wire            01/01/70 00:00      
         How to post code, and possible hang-up            01/01/70 00:00      
         simultaneous?            01/01/70 00:00      
            would even be better            01/01/70 00:00      
               If it worked!            01/01/70 00:00      

Back to Subject List