I cannot read the correct value from Port B on the H8/3664H when using it as a digital input. Bit 0 ( Port B.0 ) always reads back as 0.
This is because Port B is also the A/D input port. The A/D is always selected as Port B by default and any bit that is selected as the A/D input will always read back 0 when read as digital I/O. To read Port B as a digital input please select a different pin as the A/D input.