CD4069 oscillator in LT Spice

Thread Starter

dotneck335

Joined Apr 5, 2021
19
OK!! That seems to work---I got a symbol on my new schematic page! I opened the .asc file with Notepad---looked OK to these newbie eyes----re-named it with .asy. LTSp sees it but no symbol appears. ??? Anyway, THANK you. I'll try to build my oscillator with this new file. Do I still need to include .uic and/or .startup to my .trans line?
 

Thread Starter

dotneck335

Joined Apr 5, 2021
19
Maybe I need to change this line in the CD4069UB file?
SYMATTR ModelFile C:\Users\eric gibbs\Documents\LTspiceXVII\MyWork\CD4069
 

Papabravo

Joined Feb 24, 2006
21,227
They are behavioral models. You can read read the actual text files that implement them. Besides the logic functions they model propagation delay, rise time, fall time and voltage levels. In some cases they use the LTspice OTA devices and in other cases they use a combination of ideal components with generic parameters. Here is the one for the 4069. It uses two diodes, a resistor, a capacitor, two MOS transistors, one n-channel and one p-channel, and a final capacitor. What do you think?

.subckt HEF4069UB a out VDD VSS params: speed=1
D1 A VDD di
D2 VSS A di
R a o 700
Ca o VSS {10p*M} Rpar=1G
M3 OUT o VSS VSS HEFn
M4 OUT o VDD VDD HEFp
C4 OUT VSS {10p*M} Rpar=1G
.model di d vfwd=0.5 ron={100/M}
.model Hefn vdmos vto=1.3 kp={speed*1.1m*M} lambda=15m rs={50/speed/m} mtriode=2.5
.model Hefp vdmos pchan vto=-1.5 kp={speed*1.1m*M} lambda=45m rs={70/speed/m} mtriode=1
.ENDS
This subcircuit from Bordodynov's "HEF4000.lib" file has a small error in it and probably could use a comment explaining the use of VDD and VSS for the newer users. First the correction:
Change the line "R a o 700" -- to --> "R a o {700/M}", without the quotes. Don't forget the curly braces. This will size the input resistor appropriately.

Second, this device implements a mechanism for the subcircuit to "discover" the potentials of VCC and VSS without the necessity of explicit power connections cluttering up the schematic. Putting a label of "VCC" on the output of a voltage source is straight forward and works just fine. Unfortunately you cannot put a label on the Global common net 0. LTspice will just ignore the label without so much as a "by your leave". There are three possible solutions:
  1. Edit the SpiceModel line of the HEF4069 Symbol from "VDD VSS" -- to --> "VDD 0", calling out Global Node 0 as the explicit ground
  2. Create a "floating" ground with a monster resistance to Global Node 0, and label the net connected to the "floating" ground as "VSS"
  3. Attach the minus end of a 0 Volt source to GND (Global Node 0) and label the other end VSS.
I modified the "Bug Report" file to show alternatives 1 and 3.

Bordodynov's library can be downloaded (It is the 16M file) from the following site:
http://bordodynov.ltwiki.org/
 

Attachments

Last edited:

Thread Starter

dotneck335

Joined Apr 5, 2021
19
Well, there's definitely something very different between the circuit I drew and the one that eetech drew, because his works just fine.
 

Papabravo

Joined Feb 24, 2006
21,227
Well, there's definitely something very different between the circuit I drew and the one that eetech drew, because his works just fine.
Here is your file back. It doesn't oscillate, but it does run without error.

When you run the one that works, check the Spice Error log to see what might be allowing it to run. You should not trust simulations that "Run" with errors
 

Attachments

Papabravo

Joined Feb 24, 2006
21,227
Pardon me, I'm pretty green. How do I check the Spice error log?
No problem.
After running the simulation you should see either a Waveform Viewer or an Error message.
To check the Error Log, you go up to the Menu Bar and Left-click "View", then from the drop down menu, about half way down, select "SPICE Error Log". The error log will show up in a modal window. Look at it then close it and resume your activities.
 

eetech00

Joined Jun 8, 2013
3,959
This circuit CANNOT work correctly. It has no ground and the IC statements both have bad syntax.
You did not say what error messages you got, but those were the ones I noticed.
the raw A devices do not need power connections.
In addition, if an input pin requires a ground connection, it should be pulled down thru a resistor or another device. And NOT connected directly to ground.

the A devices are not meant to replace an accurately modeled component. They are meant to make it easier to design a model.

but they can also be used as a quick method for”proof of concept”, as I’ve shown in my previous post...
 

Papabravo

Joined Feb 24, 2006
21,227
no...the ic statements do not have bad syntax...
Not in your circuit - in the one that dotneck335 copied from you picture. He used a lower case 'ell' for upper case 'eye' for the inductor initialization and he forgot the 'dot' in front of 'IC' for the capacitor initialization and he had no ground in the circuit which resulted in the usual time step too small error. Not bad for a first timer. I give him credit for his industry.
 

Papabravo

Joined Feb 24, 2006
21,227
the raw A devices do not need power connections.
In addition, if an input pin requires a ground connection, it should be pulled down thru a resistor or another device. And NOT connected directly to ground.

the A devices are not meant to replace an accurately modeled component. They are meant to make it easier to design a model.

but they can also be used as a quick method for”proof of concept”, as I’ve shown in my previous post...
I know they don't need power connections but there needs to be a ground somewhere and there did not seem to be one in the one that dotneck335 posted. Rather than throw stones at me why don't you take his file and debug it.

Maybe you there are settings, different from the standard settings, for solver and integration method, that allow one sim to work while the other one gets a time step to small error. Figuring this out from the error message for those who have never encountered this error is pretty tough. It happens all the time with oscillators.
 
Last edited:

Thread Starter

dotneck335

Joined Apr 5, 2021
19
I don't think eetech is throwing any stones. He DID take my file and fix it---his drawing works perfectly fine. Thanks for noting my mistakes--I corrected the error in my .ic command. I now see that the text indicated on eetech's drawing "params for each inverter" are intended to go into each inverter's 'component attribute' file; I put them there. Now my sim runs, but with a ~10x higher frequency than his. I also see the text "IC=0" under the value for C1; right-clicking on it reveals that it is a 'value 2 for C1'. What is THAT?? I also see the text 'CLK' on eetech's drawing, but entering that as a directive gives a 'missing node' error. ?????
 
Top