Working on MC9S08PT16 controller. Unable to glow LED on PTC2 port. Have tried on multiple boards. Have enabled output ports and disabled input ports. Am I missing something ? Below is my code. Any assistance/code would help. Thank you in advance.
Code:
void main(void) {
PORT_PTCIE = 0x00;
PORT_PTCOE_PTCOE2 = 1;
PORT_PTCPE = 0x00;
PORT_PTCD = 0x00;
while (1) {
PORT_PTCD_PTCD2 = 1;
}
}
I am also having the same issue. any help or code would be greatly appreciated.
Thanks in Advance.
Hi
Normally you on only need
//PTC2's Output Enable Register is set to enable output
PORT_PTCOE_PTCOE2 = 1 ;
//PTC2 pin is driven low (LED OFF)
PORT_PTCD_PTCD2 = 1;
I test it on the evk and this is working
Hi ,
Finally, I found the solution.
even after doing this PORT_PTCOE_PTCOE2 = 1, we may not be able to get the output.
because the port ptc2 is works based on the priority.
here what the happening is we are having the TSI8 input for the same ptc2 port, so it is giving high priority to the alternate TSI8. so, we must do the input reading pin zero (0).
TSI_PEN1 |= 0x0.
Now after doing this, it will consider PORT_PTCOE_PTCOE2 = 1 this as high priority and will generate the output.
Regards@MSR ...!