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

Back to Subject List

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


 
#85277 - Use MASK rather than bit address
Responding to: ???'s previous message
As an answer also to the question given in a new thread: in both designs, all the 1-wire IOs are located on the same port. This gives an easy option to use a single mask in order to address individual lines/devices.
An asm example, not correct, just an illustration of the idea:
IO0     EQU    01h
IO1     EQU    04h
IO2     EQU    10h

  ....
        mov    r2,#IO0
        call   Reset1W
        mov    r2,#IO1
        call   Read1W
  ....
Reset1W:
        mov    a,r2
        cpl    a
        anl    P2,a      ;pulsing line LOW
        call   Delay1
        mov    a,r2
        orl    P2,a      ;pulsing line HIGH
        call   Delay2
        mov    a,P2
        anl    a,r2      ;sampling the input
        ret              ;test acc for zero to get the input bit
....        


This scheme allows also manipulate the lines simultaneously (ORing the masks together), as suggested by Andy.

Jan Waclawek


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