This content has been marked as final.
Show 1 reply
-
1. Re: Modify drive mode
content.librarian Jun 29, 2009 5:08 AM (in response to falcon.chang)Hi,
I do not know what is complete application and in which context you are doing it. But I can explain what these lines of code are doing.
PRT0GS &= ~0x08; //disconnect from global bus
PRT0DM2 |= 0x08;
PRT0DM1 &= ~0X08; //DM[2:0]=100, Slow strong high, high-z low
PRT0DM0 &= ~0x08;
PRT0DR &= ~0x08;
It will disconnect pin P0[3] from global bus if it was connected earlier. Then it will change drive mode for P0[3] to open drain drive high. Then P0[3] is turned to High-Z output by writing a '0' to its data register.
PRT3GS &= ~0x02; //disconnect from global bus
PRT3DM2 |= 0x02;
PRT3DM1 &= ~0x02; //DM[2:0]=100, Slow strong high, high-z low
PRT3DM0 &= ~0x02;
PRT3DR |= 0x02;
It will disconnect pin P3[1] from global bus if it was connected earlier. Then it will change drive mode for P3[1] to open drain drive high. Then P3[1] is turned to High output by writing a '1' to its data register.
Best regards,
Sachin Gupta