Sabths:
I need to activate several digital outputs at the same time, for example output 2.3 and 4,
[snip]
How could I do it?
Use PORTD. For D2-4, you write bits 2-4 of PORTD. Just take care to not affect other bits.
This is what I did to use D6-13 as an 8 bit address to a DRAM (I wanted to use D0-1 for serial output):
// PORTB: set last 6 bits to 0; OR in top 6 address bits
// PORTD: set high 2 bits to 0; OR in low 2 address bits
#define SETADR(x) \
PORTB &= ~077; \
PORTB |= (x)>>2; \
PORTD &= 077; \
PORTD |= (x)<<6;