Multisim11 PIC16F84 Digital Clock

Thread Starter

Code39

Joined Aug 20, 2011
10
Howdy everyone! I'm currenlty trying to design a Digital clock in Multisim based on the PIC16F84. I found the instructions on this website. I've now built the whole circuit in multisim and done some testing, the clock does not seem to be working. I've replaced the 4Mhz crystal in the description with a 3Mhz, I know the clock won't be having the right frequency but there was no 4Mhz crystal in the libraries. So I'll be looking into that later.

I've done some measuring and the crystal does not seem to oscillate. So if there is anyone here who would have a look at it I would be grateful!

Here is the ms11-file.
 

Kingsparks

Joined May 17, 2011
118
Hi Code39.

Apparently the file you linked to this thread requires multisim to download. I don't have that program. If you could do a PDF of the circuit or even a screen shot I could then review it.

I guess there are enough people on the forum with multisim you should get some response so whatever you choose. :)
 

Thread Starter

Code39

Joined Aug 20, 2011
10
Well, I've done some measuring and it seems like the PIC has a too low output voltage for the seven segment to light up. The voltage coming from the outputs are only 1,45 V while the seven segments seems to be working at it's best at 2-4V.
 

Kingsparks

Joined May 17, 2011
118
That should be enough to turn on the drivers for the display. What are the specifications on the display? I noticed they are powered by the 7805 or 5V.

Also it looks like each segiment is enabled by grounding. Check to see that they are grounding maybe?
 
Last edited:

Thread Starter

Code39

Joined Aug 20, 2011
10
That should be enough to turn on the drivers for the display. What are the specifications on the display? I noticed they are powered by the 7805 or 5V.
Have you checked the pdf of my schematics? The measured voltage between the outputs and ground is 1,45V. And the crystal won't oscillate, if the crystal was working as it is supposed to be the PIC might supply the "extra" voltage? The seven segments have common cathode so the supply comes trough R1-R7 and goes trough the transistors if R10-13 gives enough voltage between base and emitter. And the emitters are all wired to ground.
 

Thread Starter

Code39

Joined Aug 20, 2011
10
I've done some changes: I've changed the generic transistors to BC109BPs (nearly equal to the 2SC828) and rechecked the program. Now i acctually get a result, the seven segments have started to work in a sense. Some times all of the segments lights up un the D-diode other times the first segment (U1) shows a A , 0 or 8 for a climpse of a second.

I've done some measuring with an oscilloscope and here are some pictures:
Pin "D" to ground:

Base to emitter on transistor 1 (Q1):

Base to emitter on the rest of the transistors (measured on Q2, but they are all the same):


Click on the images for higher resolution.

So what am I doing wrong here, and where should i start looking?

The circuit:
 

Attachments

Last edited:

SgtWookie

Joined Jul 17, 2007
22,210
Looks to me like you have the 7805 connected backwards; you're feeding 6v in to the VREG and expecting the output to come from LINE VOLTAGE. Admittedly, that's not the standard naming for those connections, but in schematics, the inputs usually come from the left, outputs flow towards the right. However, a 7805 needs ~ 2v more input voltage than the output voltage; so to get 5v out, you need 7v in. You also need a 0.33uF cap to ground on the input, and 0.1uF on the output to ground.


I don't know what the Vf of the LEDs in your displays are at what current. Any idea? I suggest you try running 15mA through one of the segments to the common cathode connected to ground, and see what the Vf is. Use a constant current supply.

Then re-calculate your current limiting resistors.

The base resistors for the NPN's are a big problem. You need to use Ib=Ic/10. The minimum resistance you should use from a PIC output to control an NPN base when the Vcc is 5v is 4.2/20mA = 210 Ohms; 220 is the closest standard value.

Right now you are using 10k Ohms for the base resistors. That will saturate the transistors up to only ~4.3mA collector current. If you divide 4.3mA between 7 segments, they will be awfully dim; about .61mA/segment, and you're multiplexing them for a 1/4 duty cycle.

With 20mA coming in on the base, you'll be able to sink ~ 200mA total on the collector. But, if you're only using 15mA per segment, you'll only need about 105mA max collector current; and about 10.5mA base current; so use base resistors of 4.3/10mA = 430 Ohms, which is a standard resistance value.
 
Top