Electronics > Proteus

Blinking Circuit Works in Simulation but Fails in Breadboard

(1/2) > >>

Arkonite:
Hello,

I have this blinking circuit that is programmed in C and uses the PIC16F84A. I already got it to work in Proteus 8 but my problem is that I can't get it to work on a breadboard. I'm posting here right now to ask for guidance on whether I have missing or incorrect circuit connections. I also already connected the VDD and VSS when testing on a breadboard.

Attached below is a picture of my simulation and code which works as follows:
If switch 2 and 3 is close, led D6 and D8 will light up.
If switch 1,2, and 3 is close, only led D6 will light up.
If switch 2,3, and 4 is close, only led D8 will light up.
Otherwise, any other switch combination will cause no led to light up.

jpanhalt:
1) The 16F84A does not have an internal oscillator.  What are you using?  Related to that, you have OSC1/CLKIN grounded.  Will that work?
2) I would add small resistors in series with each LED to limit current.

ledtester:
I don't see a timing capacitor in your circuit. Here's what the PIC16F84A datasheet says about using an RC-oscillator for a clock (page 23):

https://ww1.microchip.com/downloads/aemDocuments/documents/MCU08/ProductDocuments/DataSheets/35007C.pdf


Ian.M:
Your circuit's no good.  The PIC16F84A does *NOT* have an internal oscillator so its sitting there doing diddly-squat!  You'll need to provide either an external clock signal, a crystal + load capacitors, or a RC network as per PIC16F84A datasheet section 6.2 Oscillator Configurations.  As MikroC doesn't support setting CONFIG words in your code, you'll also have to choose a suitable CONFIG that lets your chosen oscillator type actually work  in your programmer utility whenever you program the chip.  See: datasheet section 6.1 Configuration Bits. 

*NONE* of the oscillator modes can work with OSC1 grounded! |O
N.B. RC oscillator mode is only suitable for use with the fig. 6-3 circuit, and cannot be used with an external clock.

--
I hate intensely dislike this new editor! - https://www.eevblog.com/forum/supporters-lounge/editing/

Arkonite:
Thanks to everyone for their help last time. After some changes in the code and circuit, I managed to make it work on a breadboard, but I ran into some problems after connecting the output of my IR sensor to the PIC16F84A Port A pins, which are set as input. I tested the IR sensor, and it works fine, but the moment I connect it to the breadboard, the LED indicator lights up permanently for some reason, which should really only be triggered if there is an object nearby that reflects the IR lights emitted. I have attached below a picture of the exact IR sensor that I used, and if I base it on the circuit, it seems like the PIC sends back a voltage to light up the indicator LED of the IR. I have 4 IR sensors connected to 4 Port A pins, and every single one of their indicator LEDs lights up after being connected. So my questions are as follows:


1. Is it normal for voltage to be present at the pins of the PIC even though it is set as an input?
2. Do I have to set these Port A pins with a voltage "low" in the code?
3. Should the 5 volt VCC of the IR sensor be independent of the VCC of the PIC16 so that they won't share a common ground?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod