Hello,
Initially, the pin is configured as input by Code generator
During runtime, I want to change it output using this code:
PM1 |= _00_PMn4_MODE_OUTPUT;
But I am not able to control the pin after that.
If the pin is initially configured as output, It works as expected.
Any idea?
Thank you
Does PM14 bit value change ? Try also with this code:
PM1_bit.no4 = 0; // Set P14 as output.
Hi,
I have checked, the value of _00_PMn4_MODE_OUTPUT is 0 so it is impossible to clear the 4th bit by the code above
I got it fixed by this: PM1 &= ~(1 << 4);
I have not tried PM1_bit.no4 = 0; but I think it should be ok too.
Thanks
Tonny said:I got it fixed by this: PM1 &= ~(1 << 4);
Yes, this works too. The PM register bits can be either either by 1-bit(my code) or 8-bit instruction (your code).