Rafael: It may be that you misunderstand the use of output_low(). The argument for this has to be a pin name. Like output_low(PIN_A0). And a pin name will be a constant. I'm not sure how a value like 31744 could every be appropriate here. You could use a switch or if construction to test a condition and set various different pins based on the test condition: if (value == 31744) output_low(PIN_A0); else output_low(PIN_A1); However, output_low(31744) would only make sense if 31744 referred to a pin. You could also use the BIT_CLEAR command to accomplish this: BIT_CLEAR(PORTA, 3); Here, I believe the "3" could be a variable since it actually refers to a pin number, not a pin name. However, I haven't tried this. John Hansen Rafael Vidal Aroca wrote: > > Hi people, > > i'd like to easily control all ports of my pic. I've been trying to > use output_low() and output_high() from ccs c, but seems that these > functions work only with constatns. Won't they work with variables? > > I'm trying something like that > > output_low(31744); // this works > > value = 31744; > output_low(value); > > ccs says that the expression must be a constant. > > any ideas? > > thanks > > Rafael. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist