I am attempting to simultaneously learn how to use a microcontroller and regain my long forgotten and limited knowledge of C. This exercise is in anticipation of an up-coming project using an HC08 with CodeWarrior. Not having any hardware I am working with “full chip simulation” both employing PE and not. The CPU is MC68HC908QB8.
My problem is as follows:
I am trying to set three pins on the PTA port so I can read them as if they were input (I understand that in this case I am only reading the last write). These pins are PTA3,PTA4 and PTA5.
Regardless of how I try to set the pins, only PTA3 and PTA5 respond. Can anyone tell me why I cannot set PTA4?
I am confident that OSC2 and KB14 ( which share the pin) are disabled, however, I am confused about AD2.
Thanks in advance.
Thank you, bigmac, for the quick response. I confirmed your suggestions, but unfortunately I still have the problem.
mke_et
Thank you for the response.
I am using Full Chip Simulation in CodeWarrior for the debugger and, as far as this problem is concerned, I have no actual hardware. I am stepping through the program while watching the pertinent registers.
The problem only exists when I have created the project with "Device Initialization" or "Processor Expert". Something is being set by PE that does not occur if I do everything manually.
I am still not confident with my understanding of DDR, but let me say what I am doing. I have kept DDRA (for pins 3,4,5) permanently in the Output mode. I am not, at the moment, attempting to ever read these bits, but am only monitoring them. If this is in error, I don't understand why it works for pins 3 and 5, but not for pin 4.
For example, having previously zeroed PTA:
PTA_PTA3=0x01; works in that bit 3 sets to 1
PTA_PTA4=0x01; does nothing
PTA_PTA5=0x01; works
regardless of PTAPUE.
Len