Do inputs in a PIC have to be grounded? - Page 1
Forum section: electronics / beginners

author: little_carlos
author_rank: Regular Contributor
timestamp: November 17, 2014, 02:04:59 am
content: Hey guys, im here with a new questionim designing a plc with a 16f628A, and im here to see if i did something wrongthe thing is, ive seen some designs at internet and some of them have their inputs with a 10k resistor from 5v, and then they go to ground via the optoisolatorsomething like this:and in my design, i have the inputs with a 5v input, and then trough a optoisolator and a 1k resistoris there something wrong with my design?this is by the way

author: David_AVD
author_rank: Super Contributor
timestamp: November 17, 2014, 02:10:26 am
content: In your circuit the opto is pulling the PIC input up to +5V via a 100K resistor when the opto turns on, but there is nothing to make the PIC input go back to logic zero when the opto turns off.The circuit you found is a correct way of doing it. The logic will be upside down, but that's easily handled in code.

author: little_carlos
author_rank: Regular Contributor
timestamp: November 17, 2014, 02:12:45 am
content: So im doing it wrong then?in proteus works as how i want, but im not pretty sure it will on physical

author: David_AVD
author_rank: Super Contributor
timestamp: November 17, 2014, 02:14:50 am
content: Yes, your circuit is not good. Do it the way the other diagram shows.You're also missing the current limiting resistors for the opto inputs.

author: little_carlos
author_rank: Regular Contributor
timestamp: November 17, 2014, 02:30:34 am
content: is this a correct way?

author: David_AVD
author_rank: Super Contributor
timestamp: November 17, 2014, 02:35:58 am
content: Just do it the way the other schematic did;Emitter of the opto to 0VCollector of the opto to PIC input10K "pull-up" resistor from opto collector to +5VWhen the opto LED is off, the 10K "pull-up" resistor pulls the PIC input to +5V. When the opto LED is on, the PIC input will be pulled down to 0V.

author: David_AVD
author_rank: Super Contributor
timestamp: November 17, 2014, 02:38:23 am
content: If you really want the use the opto to pull the PIC input to +5v:Collector of the opto to +5VEmitter of the opto to PIC input10K "pull-down" resistor from opto emitter to 0VWhen the opto LED is off, the 10K "pull-down" resistor pulls the PIC input to 0V. When the opto LED is on, the PIC input will be pulled up to +5V.

author: ludzinc
author_rank: Unknown
timestamp: November 17, 2014, 06:17:07 am
content: Quote from: little_carlos on November 17, 2014, 02:04:59 amOh man, there is so much wrong with this schematic!VDD and VSS is mixed up, inputs should be on the left, outputs to the right, not that arsed about regulator arrangement.This is a really, really bad schematic to learn from.

author: miguelvp
author_rank: Super Contributor
timestamp: November 17, 2014, 06:58:34 am
content: Not to mention that it shows 20 pins instead of 18 and there is only one VSS and one VDD and the VDD is in the wrong pin, of course the other extra VDD and VSS are on other pins that they don't have to be at, because the extra 2 VDD and VSS are bumping the pin index making it a bigger mess.

author: macboy
author_rank: Super Contributor
timestamp: November 17, 2014, 02:45:27 pm
content: Quote from: miguelvp on November 17, 2014, 06:58:34 amThe pinout on the schematic is correct for the SSOP package of PIC16F84A (but not correct for DIP/SO). The connection of Vdd and Vss is wrong as already pointed out: Vdd is + power, and Vss is ground.

author: ivan747
author_rank: Super Contributor
timestamp: November 17, 2014, 02:55:12 pm
content: ALso, the wires are bent to an angle and the pull up resistors arent clear enough.

author: David_AVD
author_rank: Super Contributor
timestamp: November 17, 2014, 08:47:39 pm
content: Quote from: ludzinc on November 17, 2014, 06:17:07 amIn general I like the flow to go from left to right, but having it any other way doesn't make it a bad diagram. Sometimes the grouping of connectors is more important.Quote from: ivan747 on November 17, 2014, 02:55:12 pmSeriously? You guys must have so much trouble reading a lot of schematics.

author: WarSim
author_rank: Frequent Contributor
timestamp: November 19, 2014, 08:36:09 pm
content: 8th post before Vdd and Vss was mentioned! Good grief.Kudos to macboy for catching the package error.Just to set off the USA zealots. Different countries have different schematic layout conventions. Note that they are conventions not rules.No I didn't check the OPs location. I dosnt matter, unless the schematic is published in a journal, and then they will define the accepted format.The OP asked for help on function not format. Why not fully answer the question asked instead of the opinion you want to give.Sent from my iPad using Tapatalk

author: ivan747
author_rank: Super Contributor
timestamp: November 24, 2014, 08:07:17 pm
content: Quote from: ivan747 on November 17, 2014, 02:55:12 pmSeriously? You guys must have so much trouble reading a lot of schematics.Most people including me can read it, but its not as easy as if you made it look like everyone else's. In this case I find the odd arrangement unnecessary.

author: Macbeth
author_rank: Super Contributor
timestamp: November 24, 2014, 09:58:15 pm
content: I had no trouble reading the schematic. But, yeah, some things are irritating. Like the supply rail drops down a step for no reason. Also the lack of labeling supply and ground. However, schematic layout software can be this irritating too - and as a draft, ready to netlist for PCB layout, rather than a published nicely presented schema I don't have a problem at all.ETA: Is there anything in the electronics schematic capture world similar to thecode obfuscation competitions, especially beloved of C programmers?ETA2: Don't PICs have programmable pull/up/downs? Like Atmel AVRs? I've never used a PIC in my own designs before.