Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Open Drain Configuration
25-05-2012, 02:29 PM,
#1
Open Drain Configuration
I want to use one pin of the Pic32 Pinguino as an open drain to switch a transistor, which needs 5V input. So my question is how do I have to build the circuit the way the pin really has 5V?
The datasheed says I need a external pull-up resistor, so I would declare the pin as open drain in the setup and connect the pin to the 5V pin using a high resistor. But I don't think this will work because then the 5V will always be provided at the pin.
What is the correct way to use a pin as open drain an what is the syntax to set the pin to open drain? (I know I have to change the OCDx register but I haven't found the command to to so)

Thx
Reply
25-05-2012, 05:03 PM,
#2
RE: Open Drain Configuration
Hi

Yes you must put a 5V pull-up to switch an external 5V input with your board.
Depending of the input you have to drive, a value between 470 ohms and 4,7k can be used.
For the OCDX register, can you tell more about the board you are using and the pin you want to configure as open drain output ?

JP

(25-05-2012, 02:29 PM)MasterB Wrote: I want to use one pin of the Pic32 Pinguino as an open drain to switch a transistor, which needs 5V input. So my question is how do I have to build the circuit the way the pin really has 5V?
The datasheed says I need a external pull-up resistor, so I would declare the pin as open drain in the setup and connect the pin to the 5V pin using a high resistor. But I don't think this will work because then the 5V will always be provided at the pin.
What is the correct way to use a pin as open drain an what is the syntax to set the pin to open drain? (I know I have to change the OCDx register but I haven't found the command to to so)

Thx
Reply
29-05-2012, 08:47 AM,
#3
RE: Open Drain Configuration
(25-05-2012, 05:03 PM)jpmandon Wrote: Hi

Yes you must put a 5V pull-up to switch an external 5V input with your board.
Depending of the input you have to drive, a value between 470 ohms and 4,7k can be used.
For the OCDX register, can you tell more about the board you are using and the pin you want to configure as open drain output ?


I am using the Pinguino Pic32 (Rev. B). Any Pin that works is fine for me, I can switch the other functions to the remaining pins.
Reply
03-06-2012, 02:41 PM,
#4
RE: Open Drain Configuration
Is there anyone who can help me? I need to have a switchable 5V Pin because I want to switch a relais on and of with the pinguino which needs an input voltage of 5V.
Reply
03-06-2012, 04:36 PM,
#5
RE: Open Drain Configuration
This looks like a general hardware question that google can help you answer.

John
Reply
05-06-2012, 08:40 PM,
#6
RE: Open Drain Configuration
I haven't found the answer I am looking for on google, otherwise I would not have asked. This is as far as i got:

I can connect the open drain pin with a pull up resistor to 5V and attach the relais to the pin. But then the current would flow all the time, either through the relais or through the open drain. That seems pretty inefficient.
The other solution would be to connect the relais with a resistor to 5V and then connect it to the open drain pin. This should work as far as I know.
But this only works as long as I have to seperate circuits (one for the signal and one for the powered led/motor/etc.
But if I want to replace the relais with a transistor I dont know if this will still work because then the open drain pin is the sink for the signal AND the powered devide, it might exceed the maximum current for open drain pins.

How should I build the circuit to get the relais (and later the transistor) working?

(And how do I declare a pin as an open collector? As written above, I haven't found anything about setting OCDx registers in the datasheed, the wiki or anywhere! A general list of all commands would be very helpfull!)

Thanks!
Reply
06-06-2012, 09:08 AM,
#7
RE: Open Drain Configuration
To set a pin as open drain you use the appropriate port's ODCx as you more or less say and the data sheets identify the pins & bits. What more do you need to know? (I think the answer is nothing.)

You sound not to be an electronics designer (as I am not) yet need electronic design to be done. Maybe someone will do it for you but maybe not.

John
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)