PicoMite VGA


Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8964
Posted: 07:51am 27 Sep 2022      

The RC2040 book isn't clear about how to do open drain outputs. It looks like it's possible, but it's a combination of two or three register settings. I was expecting a simple register change but no such luck.

If you only need a single pin there's a work-around, I think.
SETPIN mypin, DOUT
pin(mypin)=0

Now, to set pin low
SETPIN mypin, DOUT
or to set it high impedance
SETPIN mypin, DIN


EDIT
Found this:
  Quote  Edit: Having a closer look at the datasheet, it might be possible after all.
The GPIOn_CTRL registers allow to set control of output signal and output enable from the currently selected function independently.
That means we should be able to drive outputs open-drain if we set OEOVER (output enable) to 0x1 (inverting) and OUTOVER (output signal) to 0x2 (drive output low).

I still have to test and verify that, but it looks promising!

Edited 2022-09-27 17:54 by Mixtel90