Paul De Marni

9S12XDP512 Port M oddity when used as GPIO

Discussion created by Paul De Marni on Jul 3, 2007
Latest reply on Jul 4, 2007 by Paul De Marni
I am using Port M as GPIO, the entire port is set to output.
I am currently testing the output with a bank of 8 LED's, and have found that when outputting a "1" to Bit 1 of the port, Bit 0 goes high at the same time when it should be low.  The same problem happens when Bit 3 has a "1" output to it, Bit 2 goes high at the same time!
Bit 4-7 work as expected okay, follow all outputs correctly.
 It is not a solder short on the board as I can turn on either Bit 0 or Bit 2 without affecting the higher bit.
MSCAN normally uses this Port, but micro is in the out of reset state which I believe is disabled. I'm hoping that  I have not set up the Port correctly as opposed to some bad silicon here. Any suggestions?
My setup;
                   LDAA  #255
                   STAA  DDRM       ;Set PortM DDR to output
                   LDAA  #8              ; Turn on PM 3 output
                   STAA   PTM
                                         PM3 and PM2 are now BOTH high!
                 STAA   PTM          ;Turn all outputs off
                                        All outputs off normal
                LDAA  #4
                STAA  PTM           ;Turn on PM2
                                       PM2 on only as expected