Please help me in port D configuration

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

Please help me in port D configuration

1,495 次查看
bitasobhani
Contributor III
Hi all
I am using Freescale HCS08 MCU.
I want to configure port D as input. I wrote the followong code:

  //TPM1SC=0x00;
  //TPM2SC=0x00;
  
  PTDDD = 0x00; // set all pins as input
  PTDPE = 0x00;
  PTDSE = 0x00;

The problem is that in this case that port D is configured as input, no internal timer can work, also no wireless communication can occur (AF_DataRequest does not work). This problem also exists if the fist two lines are not comment.
Please help me
THANKS
标签 (1)
0 项奖励
回复
3 回复数

488 次查看
Andrey
Contributor III
The module enable takes control over the pin setting so the first two lines should not be commended, but what exactly is your problem?


0 项奖励
回复

488 次查看
bitasobhani
Contributor III
Thanks for reply
My problem is that when port D is configured as input, I can't have any timer and also any wireless communication with the node. But the problem is solved when port D is configured as output.

Thanks
0 项奖励
回复

488 次查看
Andrey
Contributor III
I still don't see what you are trying to accomplish.

You probably are aware of the fact that you can configure each individual pin on port D separately so some of them are used as inputs some as timers.

It IS possible to change the state of the port (or pin for that matter) back and forth but you have to be careful about the timings, depending on your application you might need to have a small delay between the switches.
0 项奖励
回复