• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

New Spice model for CD4046B phase-locked loop IC.

alec_t

Well-Known Member
Most Helpful Member
Thread starter #1
The current Yahoo LTspice User Group's model does not model the VCO section fully, so I home-brewed one which better reflects the functionality as set out in the Texas Instrument Application Report SCHA002A and the datasheet. I've uploaded the model and ancillary files to the User Group, but attach them here if anyone wants to play. Any bug reports gratefully received.

Edit: See post #9 and revised model posted there.
 

Attachments

Last edited:

Mikebits

Well-Known Member
#2
Very nice of you to share your work :)
 

alec_t

Well-Known Member
Most Helpful Member
Thread starter #3
Thanks. Hope someone finds it useful.
 
#4
Thanks. Hope someone finds it useful.
I do find it useful although I believe there's a bug: for some reason the PC2out is pulsing between Vdd/2 and Vss, not between Vdd and Vss as it should. I looked at the netlist but couldn't figure it out, perhaps you can take a look at it.

Thank you!
 

alec_t

Well-Known Member
Most Helpful Member
Thread starter #5
Thanks for the bug report.
Here's what I get when I run the Test file I included in post #1.
PC2out.PNG
Seems ok to me. Before lock is achieved the pulsing is 0V to 5V as expected. Whether the phase difference is positive or negative will determine whether the pulses are predominantly above or below the prevailing mean point. The PC2 output is a three-state one, so becomes biased at the capacitor voltage of the low-pass filter attached to PC2. This tends towards Vdd/2 as lock is approached.

[Edited]
 
Last edited:
#7
Yesterday I wired up a CD4046B on a breadboard to verify a simulation made with your model. The circuit didn't work, but it did when I inverted VCOout (after CompIn).
The same simulation using a 74HTC4046 model (file attached) produced the correct polarity of VCOout.
So I concluded that your model may need to invert the output VCOout and invert the input CompIn in order to match the component.

P.S. to use the 74HTC4046 model properly, you must define a parameter VCC, which this model uses for digital levels.
 

Attachments

alec_t

Well-Known Member
Most Helpful Member
Thread starter #8
Thanks for that. Datasheets don't tell all. Nice to have it field tested, as I wasn't able to when I created the model. I'll look into it.
 

alec_t

Well-Known Member
Most Helpful Member
Thread starter #9
Ok. Have modified the model as you suggested. Works ok in sim, but i'd appreciate it if you could compare its performance with the real IC and let me know the outcome.
Revised model attached.
 

Attachments

#10
Thanks for improving this model. I need it to make an intelligent decision about the best phase comparator to use in my application... no time to get a PhD in PLLs!

I would like to use one of the higher frequency 4046-types, like the 74HCT4046 identified in message #7, which produces a third phase comparator output (R-S FF). Sadly, the model in the zip file says there is a problem interpreting the VCO input. Do you have the time to add the third phase comparator? I would be happy to validate it on the bench.
 

alec_t

Well-Known Member
Most Helpful Member
Thread starter #11
Third comparator added.
Attached is my model of the CD74HC4046A, based on the somewhat skimpy TI datasheet and the 4046 model already posted. I'd be interested to know how it compares with the real world IC.
 

Attachments

Latest threads

EE World Online Articles

Loading

 
Top