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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/07/08 21:33
Read: times


 
#158916 - Routine parameter for port pin
Hello,

i have this problem. I have routine for 1-wire bus for ds1820 digital thermometer. But I have two the same devices, one on pin P2.0 and another on pin P2.1. I have written routine to communicate with the device. Problem is that I have defined bit variable " DS1820 BIT P2.2 " and used in the communication routine this way (example):

DS1820_RCV_BYTE:
MOV R5,#8
DS1820_RCV1:
CLR DS1820
NOP
NOP
NOP
SETB DS1820
MOV B,#12 ; WAIT 12µs
...

Is there any way, how to call communication routine and use the DS1820 variable as parameter, once filled with address of P2.0 and once with P2.1 ?
How can I achieve, not to write two different comm. routines for each port pin?

Thank you for advice,

Stepan


List of 3 messages in thread
TopicAuthorDate
Routine parameter for port pin            01/01/70 00:00      
   write two different routines!            01/01/70 00:00      
   as long as it is on one port...            01/01/70 00:00      

Back to Subject List