Topic : How to define a bit on a port? How to say P1.1 = 1?

Forum : 8051

Original Post
Post Information Post
February 7, 2019 - 5:02pm
Lloyd Slonim

Dear compiler experts,

I want to define a variable to be a single bit on an output port. I tried doing "#define MotorOutputBit P1.1" but when I use MotorOutputBit I get syntax errors. I looked in the manual and couldn't find it. In the compiler I am porting from it is written as "bit MotorOutputBit@0x91;" but when I tried to specify the address using "at 0x91 bit MotorOutputBit;" I got error C165, absolute specifier illegal.

Thanks for any help,

Lloyd

Replies
Post Information Post
+1
0
-1
February 8, 2019 - 8:38pm
Lloyd Slonim

I found the sbit command, so this issue is closed

Thanks,

Lloyd