// Forum: https://forum.arduino.cc/t/reading-portb-giving-odd-results-using-a-nano/1131576
// This Wokwi project: https://wokwi.com/projects/365868922987712513
// Note: When the crystal is used, the PORTB6 and PORTB7 pins are
// internally disconnected.
// So it is okay to set DDRB for all bits.
void setup()
{
Serial.begin(115200);
DDRB=0;
}
void loop()
{
byte x = PINB;
Serial.print(x);
Serial.print(",");
delay(150);
}