Couple of things
Are bits 3 and 2 “don’t care” also?
You describe bits 6 and 7 as “don’t care” but it is a little more than that. Those bits are the Arduino clock signal and you should not be writing them at all.
Rather than using PORTB=stepper[j ] it would be better to use PORTB &= xxxx to clear the bits that need to be 0s and PORTB |= yyyy to set the bits that need to be 1s.
Robin, I polished a little bit my prior tables considering your apt comments. I am also using the Arduino nomenclature for the PORTB bits and elaborating a bit more the driver and motor functioning.
Here also a simplified schematic of the system (notice that I have obviated the ESD protection diodes, so be careful if you want to implement this solution).
Robin, regarding your questions…
Bits 1 and 2 of PORTB (digital pins 9 and 10) are connected to the ENABLE input pins (6 and 11) of the L298 bridge driver as shown in the above schematic.
You are rigth about bits 6 and 7 but notice that I set only the digital pins 8 to 13 (PORTB bits 0 to 5) to output bits as part of the setup() function. Bits 6 & 7 shall remain as input.
I’d use PORTB &+ and PORTB |= but I thought using stepper[j] made the code more elegant.
Finally, I think that the big thing with the code is that permit the user a full control of the stepper. Notice for example that with ST28, you can get 2048 steps per revolution which means 0.17 DEG per step as minimum resolution! It’s very convenient for applications that required accurate positioning. I am also using full step sequence that provides more torque.