hi everyone , i’m a new member over here , i found this forum really interesting
i have a mini project for next tuesday wich topic is "traffic lights "
i didn’t know how to add a program written with ‘pic c’ , to kicad
isn’t like ’ proteuse isis’ !!
please i really need help
Wouldn’t you need the microchip tools for programming?
KiCad is for schematic and pcb design. It don’t have built in simulation of any kind.
I don’t know about Microchip MCUs, but usually one does not deliver power from the MCU to a load like an LED but sinks it… this means, the MCU pin is sitting on the GND side and connecting the LED to GND whenever the LED needs to light up.
This is because MCU’s are better in sinking current towards ground then to deliver current as a source.
http://www.microchip.com/forums/m535266.aspx
…I’m using a 16f628. Looking at the DC spec, it looks like it can hold Vdd-0.7 volts when sourcing 3mA vs. 0.6 volts when sinking 8.5mA, so it looks like sinking 20 mA is the way to go…
http://www.microchip.com/forums/m438944.aspx
…usually the sink-capability is a little bit better then the source-capability. For example, the 18F2220 can sink 8.5 mA (output voltage max. 0.6V - see param. D080), while it can source “only” 3.0 mA (output-voltage min. 4.3 V - see param. D090)…
I’m an Atmel AVR guy, but going by above numbers your LED will be 3 times as bright (if it can handle the current) when you sink instead of source the power to it via the MCU (as you currently do in your schematic up there)…
And while you’re at it add resistors to restrict the current going into those LEDs (depending on color and semiconductor type the voltage is usually 2.7V and 10mA for a pretty bright experience for red/green and 3.2V and 10mA for a very bright experience in blue/white), as otherwise you might burn them up.
The resistor is setting the working point of the LED, as an LED alone can’t do that and will try to conduct as much current as the source can deliver and more… it can never get enough so to speak
Check the datasheet of your LEDs for those values, I’m just guessing there.
For sizing the resistor it needs to dissipate the remaining power that you get when you subtract the LED voltage from the supply voltage.
(V_supply_ - V_led_) / I_led_ = R
Example:
(5V - 2.7V) / 10mA = 230 Ohms
Look for a resistor that is common and don’t chase the exact value… search for an E series resistor.
There is E6, E12, E24, E48, E96, etc… the higher the series count, the finer the value sparation, but also the harder to get the resistor and usually more expensive.
E24 looks like this:
So you would take a 220 Ohm or a 270 Ohm resistor if you go for what’s available in E24.
thank you all guys i really appreciate it , such a nice forum