This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Need to switch Outputs from Sink to Source

We have our Hercules Safety Micro controller mounted to a daughter, and need to see if there is any way to reconfigure our output from PNP to NPN or from NPN to PNP. Our current outputs are sink driven but need to run a device that require source driven outputs. Any help would be greatly appropriated .

  • Hi Brian,
    The micro is built on a CMOS technology.
    The pin, say GIOA[2] for concreteness, starts as an input. In order to control the pin, you must:
    enable the peripheral selects through the peripheral Power Down Clear Registers
    set the Peripheral Enable bit
    write a 1 to GIOGCR0
    set GIODOUTA.2 = 1 (high, source if output) -- GIODOUTA = 0x04 or GIODSETA = 0x04;
    set GIODIRA.2 = 1 (output) GIODIRA = 0x04;

    Obviously the pin polarity can be switched by writing GIODOUA.2 = 0...

    Best Regards,
    Kevin Lavery