I would like to call function like port(P0,1,2).i want to assign the values of 0 and 1 to P0.1 and P0.2 using that function prototype only...how can i assign the values to port pins.what are the steps i need to follow...
Thanks in advance
chinnaye
i want to use function is
You've told us that about a dozen times already. And you've been told just about as often
1) that this is a bad idea, for the controller your using 2) how you can do it, if you still think you have to.
So what on earth do you think you'll achieve by posting the same question yet another time?
Did it still not occur to you that just because you want something doesn't mean you'll get it?
How to read port pins in port(P0,x1,x2)?
temp1 = 1 <<= x1 temp2 = 1 <<= x2 temp2 |= temp1 temp3 = p0 temp3 &= temp2 return (temp3)
the above describe the needed process maybe not the most elegant way, but that (1 <<= x2) is the only way you can process port pins defined in a function header.
since you refuse to accept the inability to indirectly address bits, BEFORE YOU POST AGAIN study (I did not say 'read') "the bible" chapter 2. www.8052.com/.../120112
Erik
Note the <<= shifts and assigns - so left side better be assignable.