Open Drain GPIO ?

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
brad
Posts: 23
Joined: Thu Jan 13, 2011 2:51 am

Open Drain GPIO ?

Post 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

brad
Posts: 23
Joined: Thu Jan 13, 2011 2:51 am

Re: Open Drain GPIO ?

Post 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.

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: Open Drain GPIO ?

Post 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.

brad
Posts: 23
Joined: Thu Jan 13, 2011 2:51 am

Re: Open Drain GPIO ?

Post 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.

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: Open Drain GPIO ?

Post 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?

brad
Posts: 23
Joined: Thu Jan 13, 2011 2:51 am

Re: Open Drain GPIO ?

Post 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.

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: Open Drain GPIO ?

Post by xol »

Here are two options:

NPN Transistor
2N2222.jpg
2N2222.jpg (24.36 KiB) Viewed 16975 times
N-channel MOSFET
2N7002.jpg
2N7002.jpg (28.19 KiB) Viewed 16975 times
Consider the fact that

IN="0" OUT= Open Drain
IN="1" OUT= "0"

Post Reply