Please help me in port D configuration

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Please help me in port D configuration

2,024件の閲覧回数
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 返答(返信)

1,017件の閲覧回数
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 件の賞賛
返信

1,017件の閲覧回数
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 件の賞賛
返信

1,017件の閲覧回数
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 件の賞賛
返信