AnsweredAssumed Answered

IO Function Switching

Question asked by warnke.doug.001 on Jul 15, 2014
Latest reply on Jul 17, 2014 by Erwan Y
I have a project that requires an IO pin to switch between High Z (Tri-State) and High. On a previous 8 bit micro the high z condition was satisfied by setting the port to an input and the high was satisfied by making the port and output and driving it high.

I am using the Hal drivers for non-OS and am strugglinig to find the commands to do this. I tried doing the following with o results:

// Set Charge to Output and Set High
palSetPadMode(PORT_B, CHARGE, PAL_MODE_OUTPUT_PUSHPULL);
palSetPad(PORT_B, CHARGE);
        
// Delay 5us
//osalThreadSleepMicroseconds(CHARGE_WAIT);
osalThreadSleepMicroseconds(50000);
        
// Set Charge to Input and set to high z
palSetPadMode(PORT_B, CHARGE, PAL_MODE_INPUT);

I played with different delay lengths thinking the scope missed it.
Please let me know if you have any ideas.
Doug

Outcomes