Please help me in port D configuration

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

Please help me in port D configuration

1,330 Views
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
Labels (1)
0 Kudos
3 Replies

323 Views
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 Kudos

323 Views
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 Kudos

323 Views
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 Kudos