Page 1 of 1
Open Drain GPIO ?
Posted: Tue May 31, 2011 8:13 pm
by brad
Hi,
Can the Sub20 devices be configured to operate in open collector configuration? ie if output is disabled (low), then pin has high impedance.
Thanks,
Brad
Re: Open Drain GPIO ?
Posted: Tue May 31, 2011 8:31 pm
by brad
I looked in the manual for the Atmel processor on my sub20.... looks like the GPIO can have its internal pullup resistor disabled.
Re: Open Drain GPIO ?
Posted: Tue May 31, 2011 9:01 pm
by xol
Sure. You can configure SUB-20 GPIO as input with or without pull-up
Take a look here:
http://www.xdimax.com/sub20/doc/HTML/gpio_functions.htm
We impose via API all functionality available in CPU.
Re: Open Drain GPIO ?
Posted: Tue May 31, 2011 9:39 pm
by brad
Thanks for the reply. Unfortunately I wasn't specific enough in my original post.
I would like the "fPWM" module to be open-collector... this is SPI pin #4. I could also use the 8-bit PWM module but not as desirable.
I am trying to pull down a 6.5V high-impedance load with the PWM signal. When PWM DC is 0% then the load shouldn't be pulled down.
Re: Open Drain GPIO ?
Posted: Wed Jun 01, 2011 4:40 am
by xol
Well with Fast PWM it is not possible as we use for Fast PWM HW module that do not have open-drain output.
So I see two possible solutions:
1.You can use external transistor to convert output to open-drain. If you need we can provide reference schematics.
2. With a FW modification I can give you open-drain output on 8-bit PWM
What do you think?
Re: Open Drain GPIO ?
Posted: Mon Jun 06, 2011 6:45 pm
by brad
I'll look into using the 8-bit PWM for my application.
Can you provide me the example external-transistor circuit you offered?
Thanks.
Re: Open Drain GPIO ?
Posted: Tue Jun 07, 2011 3:43 pm
by xol
Here are two options:
NPN Transistor

- 2N2222.jpg (24.36 KiB) Viewed 34809 times
N-channel MOSFET

- 2N7002.jpg (28.19 KiB) Viewed 34809 times
Consider the fact that
IN="0" OUT= Open Drain
IN="1" OUT= "0"