Main Site Documentation

IO60P16 Output Port Resistor Mode


#1

Sorry if this question has been answered before, but these forums are amazingly difficult to search (results are shown across pages with post content instead of just titles).

I am attempting to use an IO60P16 board to drive an opto-coupler buffer so that I can drive a 24 V digital signal to another device. The buffer circuit has a 1 kOhm resistor built in.

When I connect the board to the IO60P16, the output pin of the IO60P16 drops from 3.3 V to approximately 1.5 V, leading me to believe that the chip has enabled an internal resistor for overload protection.

Indeed, the IO60P16 MCU has a slew of ResistorMode values to choose from: but these are only used in the InputPort constructor.

How can I specify a ResistorMode on an OutputPort pin?

Note: when I attach the same circuit to a breakout board on my mainboard, the opto-isolator works just fine.


#2

I have found a work-around to this issue: declare the pin as an InputPin, dispose it, and then re-initialize it as an output pin.

This issue may have come up in the IO60P16 driver discussion, however, that conversation is very long and covers many topics.

In short, the IO60P16 driver should include a constructor for setting resistor modes on output pins, or in the very least should more closely match the Breakout module methods (SetupDigitalOutput, SetupDigitalIO, SetupDigitalInput). In the latter case, setting resistor mode is possible when calling SetupDigitalIO and then setting the pin result IOMode property to Output.

I have written a single method to initialize an output pin using the existing IO60P16 driver:


public static IO60P16.OutputPort CreateIO60P16OutputPort(IO60P16.IOPin pin, bool initialState, IO60P16.ResistorMode resistorMode)
{
      (new IO60P16.InputPort(pin, resistorMode)).Dispose();
      return new IO60P16.OutputPort(pin, initialState);
}


#3

On power up, I believe the pins have pull up resistors. They seem high but they will drop with any load.

I forwarded this to the team to see if there is room for improvement.


#4

@ nicholas.goodman - Have you searched the forum, there are long discussion about this chip.
I don’t use the standard driver because I’ve my own and I setup pins resistor mode for input/output when needed. But Ianlee has a good driver for this board.
If I get the link I will publish here.


#5

@ dobova, I have skimmed the very long discussion on the driver, but the way the forum is structured and searchable, I find it relatively difficult to find a specific answer to a specific question; in this case how to set the resistor mode.

@ Gus, I certainly think the official driver should implement the Resistor mode for output pins in some way. My workaround is a funny case of two wrongs make a right.

It could be argued that Dispose() should set the pin back to it’s initial boot state, when in fact it only frees the port assignment leaving the pullup mode the same. Of course, in practice we hardly ever re-initialize our hardware, so having properly implemented and complex Dispose() methods is probably overkill.


#6

My driver is at:

I’ve implemented the ResistorMode in the InterruptPort but not the OutputPort. Check out the IO60P16Module.SetResistorMode(). I believe the GHI driver has the same ReadRegister & SetRegister functions that you can use to duplicate what my function does. You would just setup your port and then call the function to change the resistor mode.