Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[SOLVED] Interfacing a PIC micro

Status
Not open for further replies.

droseman

Junior Member level 3
Joined
Oct 20, 2010
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,463
Hello,

I am trying to interface some 5V TTL signals through an optocoupler to a microchip PIC16C55A microcontroller. I need to calculate the current to drive my opto with so that I won't damage the input of my micro.

When I went to the datasheet for the PIC, I found that:

Max. current into an input pin (T0CKI only).................................................................................................... ±500 mA

With a CTR of 200% on my opto and a 1mA minimum input current, how do I interface the micro input without damaging it?

Is there another line in the datasheet which will tell me the maximum input current of an IO pin? Most of the data seemed concerned with output current source and sink..

Hopefully someone can help me sort out this interfacing issue.

--dave
 

bjuric

Advanced Member level 4
Joined
May 4, 2011
Messages
115
Helped
32
Reputation
64
Reaction score
30
Trophy points
1,308
Location
Serbia
Activity points
1,980
I didn't get exactly what You need.
If You use the PIC pin as an input, it is high impedance and there is no current rating (it draws almost no current).
If You use the PIC pin as an output, it can sink/source up to 25mA, so for 5V you should use at least 220 Ohm resistor.

I don't think You need an opto if You're interfacing a 5V TTL to a 5V PIC.
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,200
Helped
1,142
Reputation
2,303
Reaction score
1,119
Trophy points
1,403
Location
Brazil
Activity points
53,587
The purpose of that information maybe is related to current consumpion purpose only, due T0CKI pin is Smith-Trigger type.

+++
 

upand_at_them

Full Member level 2
Joined
Feb 26, 2010
Messages
131
Helped
21
Reputation
42
Reaction score
21
Trophy points
1,298
Location
Pennsylvania, U.S.
Activity points
1,942
dave, have another look...that's 500uA, not 500mA. It's low, because like bjuric said, it's high impedance and draws very little current.
 

droseman

Junior Member level 3
Joined
Oct 20, 2010
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,463
Hi

Thanks for all your responses, I think that I have a better idea on PIC interfacing now.

bjuric: I hadn't realised that the inputs were set as high impedance, your answer makes total sense, thanks.

I know it may sound overkill to be optically isolating this I/O, but what I didn't mention previously that my application has high voltage around it (up to 10kV) and the chance of a flashover, which I believe is coupling on to the I/O line causing firmware corruption and eventual chip destruction. This opto interface with transorb protection diodes is my solution to this problem.

Thanks again to all for replying.

Regards
Dave
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top