I have a design using the s9s12g64f0mlh. My design has front panel encoders for user input. They are simple mechanical encoders with 16 pulses/revolution. I’ve attached the Phase-A, & Phase-B signals to PAD8 (pin #34), and PAD9(pin#36). There is a pull-up, and series resistor with small cap to keep the switching noise in check. I can’t seem to read the digital state of the pin at all. Looking on both PT0AD (0x270), and PTI0AD (0x272) I get 1’s. I can change the data direction and write a state high or low. The pin drives correctly (as seen on a scope), and reports the correct status on both PT0AD (0x270), and PTI0AD (0x272). Strangely the upper nibble bits (PAD12-15) work fine as outputs, or inputs.
I have these setup bytes:
DDR0AD = 0x40
PER0AD = 0x14
I have tried playing with ACMPC (0x0260), but it doesn’t seem to be the problem.
Has anyone else seen this happen? I’ve been designing hc12’s and writing software for years, and I’ve not had a problem like this before.