9S12XDP512 Port M oddity when used as GPIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

9S12XDP512 Port M oddity when used as GPIO

1,768 Views
zdriver
Contributor I
Hello,
 
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!
   
                 CLRA
                 STAA   PTM          ;Turn all outputs off
                                        All outputs off normal
 
                LDAA  #4
                STAA  PTM           ;Turn on PM2
                                       PM2 on only as expected
Labels (1)
0 Kudos
2 Replies

503 Views
DannyM83
Contributor III
The fact that the problem happens on PM0 and PM2 which are both also used for CANRX seems to point to a CAN transceiver driving the pin high.

Does the board you are using come with CAN transceivers? If so you should disable them.

Hope that helps

Danny
0 Kudos

503 Views
zdriver
Contributor I
That was it, evaluation board does have 2 transceivers in place. After some careful cutting of board  traces to RXCAN0 and RXCAN1 , I can now use the port for GPIO. Thanks for the reply.
0 Kudos