I write code 16f628a and 16f819 chip.
I need pullup-resistor port B.
Which is best style:
port_b_pullups(TRUE); or
port_b_pullups(0b11111111);
Sorry my bad english.
elm383
Joined: 13 Jul 2007 Posts: 7
Posted: Sun Sep 14, 2008 11:20 pm
Depends on the PIC model you are using. Try looking in the CCS HELP (press F1 and search for PORT_x_PULLUPS ( ) ). If I'm not mistaken, for your case, you can't enable individual bits and only one control bit is used to either to turn all on or off. Meaning you'll have to go with just TRUE. TRUE is defined for boolean 1. If you put 0x11111111, this is equivalent to 255 in decimal.
(At least this is from what I personally understand.)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum