9S08PT60 - port A3 pin won't output

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

9S08PT60 - port A3 pin won't output

跳至解决方案
571 次查看
digisnapmark
Contributor II

9S08PT60

 

Most of my code is working fine, but PortA3 is giving me fits.

 

It works fine as an input... the debugger correctly display the pin state, but when set as an output, I cannot get it to go high. The voltage is always low, but a light external pull-up will pull it high with no current load, and even latch it high (still looks like a high-Z input).

 

I've triple checked the port addresses, made sure the other peripherals associated with that pin are disabled, etc. I've even run the code in debug, stepping through only the code starting from reset, initializing the port registers, then set that output bit... but I can't seem to make the pin output anything.

 

The other portA pins are all inputs, but a quick reassignment showed that I could control A2 as an output OK... but not A3!

 

Any thoughts?

标签 (1)
1 解答
444 次查看
eduardo_viramon
NXP Employee
NXP Employee

Mark,

In S08PT, PTA2 and 3 are true open-drain pins when configured as outputs, which means you need a pull-up to drive them high. This is because they are also multiplexed with the IIC module, they need to be true open drain.

This is documented in the RM, page 48:

http://cache.freescale.com/files/microcontrollers/doc/ref_manual/MC9S08PT60RM.pdf

I'm unsure why PTA2 worked fine, is there a load connected to it that could be acting as on output? If not, the internal pad resistance could be providing a little bit of a pull-up, but in that case it is a very weak pull-up.

PTA2 and 3 should be used as open drains when configured as outputs.

在原帖中查看解决方案

0 项奖励
2 回复数
445 次查看
eduardo_viramon
NXP Employee
NXP Employee

Mark,

In S08PT, PTA2 and 3 are true open-drain pins when configured as outputs, which means you need a pull-up to drive them high. This is because they are also multiplexed with the IIC module, they need to be true open drain.

This is documented in the RM, page 48:

http://cache.freescale.com/files/microcontrollers/doc/ref_manual/MC9S08PT60RM.pdf

I'm unsure why PTA2 worked fine, is there a load connected to it that could be acting as on output? If not, the internal pad resistance could be providing a little bit of a pull-up, but in that case it is a very weak pull-up.

PTA2 and 3 should be used as open drains when configured as outputs.

0 项奖励
444 次查看
digisnapmark
Contributor II

Thank you for the quick and relevant response!

That indeed solves the issue...  Yes, there may have been some pullup on PTA2...