Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC18 24V output voltage buffer options

Status
Not open for further replies.

Andy_123

Member
Looking for some advice from forum members:


I have PIC18F2420 based device that produces pulse train up to 65KHz on RB0/RB1. I have 3 pairs like this (RB2/3 and RB4/5), but for simplicity lets look at one pair only

RB1 it always inverted RB0.
As of today output is single ended - user connects only RB0 and GND
or differential - connection between RB0/RB1.
Currently PIC outputs going directly to user, no buffers or any other devices

Now I need have to add more options
-24 V single ended.
-NPN Open Collector up to 24 V
20mA max

PIC uses is 5V, I have internal 24V available as well.

I guess I need to add some buffer between output terminals and PIC.
Any programmable drivers that can be used up to 24V and 65KHz?

It would be nice if I can switch it from 5V to 24V programmatically as I can't add separate terminals for 5V and 24 V

Any ideas what will be esiest way to do it?

Thanks
 
Last edited:
I think you understand how to drive a 24V output with a 5V signal - use an NPN transistor as a low side driver. But I'll stick a picture in anyway. R1 should limit your current to something small - I'd use 4.7K to limit it to ~1mA. R2 should be large - 100K or so, not critical. It prevents startup glitches on the output. It wasn't clear if you wanted to drive differential 24V (-24vand +24V).
**broken link removed**
I would not support programmatic switching of the output voltage as it is very easy to inadvertently fry something. The above circuit will support both 24V and 5V, just supply both outputs as shown in the second picture.
**broken link removed**
In both cases, you will want to treat the collector terminal as ground. Note, if you want to drive relays, you should put a reversed diode across the outputs (2 diodes for the second picture.

If you insist on programmatic switching of the output voltage, you can use PNP drivers on the high side to switch between +5 and +24 which feeds the voltage terminal of your output.

What i didn't understand is your comments about differential driving. Do you mean driving so that the two output terminals switch polarity? You will need an H-Bridge for that.
 
Last edited:
Thank you for your ideas.
I really would like to have automatic switching, may be with few FET but I done really see any simple way to switch between open collector and push-pull type output (or internal resistor between collector and +V)

I probably will endup having two separate devices - one for 5 V output that I have now and another for 24V operations

For Open collector I am thinking to use ULN2803A frpm TI https://www.ti.com/lit/gpn/uln2803a

But I really prefer to get push/pull style buffer with PNP+NPN transistor output.
PNP connected to +V, NPN to GND
With only one transistor is open at any giving moment so output is +V or GND
Any ideas on this one?

What i didn't understand is your comments about differential driving. Do you mean driving so that the two output terminals switch polarity? You will need an H-Bridge for that.
Yes something similar to H bridge.
It will not drive realys - load will be some kind of optocoupler that needs reverse polarity.
 
Last edited:
I think I found what I need
older L293 and newer SN754410
Does not give me OC option but gives me differential line driver
I can put two in parallel one for 5V another for 24V
 
yes, those hbridge drivers will work. Overkill if you are driving an led in an optocoupler. You probably only need a few mA of current. Look up hbridge - lots of designs from transistors which will be cheaper.
 
Yes, 754410 is probably overkill, I need 20mA max, but I can to it with two ICs instead of having multiple transistors and resistors - like I said I have 3 pairs of these signals per PIC, so it will be 12 transistors at least and quite a few resistors.
IC is $1.60 in low qty so it should be OK.
If anyone has a better idea than 754410 please respond here.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top