Problem using VPORTx.OUTSET

On the Nano Every I'm trying to do faster bit manipulation than using digitalWrite(). The ATMega4809 has the VPORTx.OUTSET and VPORTx.OUTCLR registers which allow setting or clearing of multiple individual bits. However, when I use

VPORTD.OUTSET = B00000010;

the compiler gives the error 'VPORT_t {aka struct VPORT_struct}' has no member named 'OUTSET'; did you mean 'OUT'?

It seems odd that these registers would not be implemented but others like VPORTx.OUT are. Am I missing something here?

Virtual ports don't have OUTSET registers.

1 Like

Thanks. That's what I was missing!

However, you CAN use SBI/CBI to get single-instruction bitset/bitclear on the VPORT.OUT registers... VPORTD.OUT |= 0b10;

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.