port manipulation not supported by IDE

I want to do some port writes so I can enable multiple pins at a time. (Was easy to do with PICs). According to my research, this is possible and a number of sites give examples.

When I try it, the Arduino IDE doesn't recognize any statement as valid, eg DDRB=0xFF, or PortB=(0xFF).
They are not recognized as key words and are not highlighted.

When I try to compile, of course I get an error.

So is this a problem with the IDE? (latest version 1.8.5).

I want to simultaneously enable pins 8,9,10 on a Leonardo, which is supposedly pins in portB.

Register names are not highlighted in the IDE. This is normal behavior, and does not mean that they will not be recognized by the compiler.

The sketches will compile and function fine, provided you have selected the correct board (since available registers vary between the specific microcontroller).

Be aware that the register name is PORTB not PortB - C is case sensitive.

https://www.arduino.cc/en/Reference/PortManipulation

queenidog:
When I try to compile, of course I get an error.

Of course you also forgot to post the complete error message.

queenidog:
So is this a problem with the IDE? (latest version 1.8.5).

Doubtful; more likely the code that you also did not post.

// Edit
The below code happily compiles for a Leonardo

void setup() {
  DDRB = 0xFF;
}

void loop() {
  // put your main code here, to run repeatedly:

}

It does not do anything useful, I guess :wink: