I created a schematic of a Controlled Oscillator. Frequency is controlled by an external resistor. It's working prefectly as a schematic, but it doesn't work as a hierarchical block. The block of the oscillator also doesn't work when the frequency is fixed - i.e. sensing of the current flowing out throught RT pin is removed. Could you please advice if there is some manual what is allowed/not allowed to use in schematic when I want to create a hierarchical block.
From schematic above, I created asy file and sub file:
.subckt OSC_test Latch Start_nOK Start_OK C1 OSC_rst OSC_set RT
C1 in+ 0 100p
V1 in- 0 0.5V
V2 Hyst 0 0.5V
V3 RT 0 1V
I1 0 in+ 3.333µ
B1 in+ 0 I={if(V(Out)>2, 10*(I(B2)+I(I1)),0uA)}
S1 0 in+ N006 0 OSC
A1 N005 N007 0 0 0 N006 OSC_str 0 SRFLOP Vhigh = 1V
A2 Start_nOK Start_nOK 0 Latch Latch 0 N007 0 OR
B2 0 in+ I=-I(V3)*0.989
C2 N005 0 10n
R1 N005 Start_OK 12k
B3 N002 0 V=if(V(in+_,in-_)>V(hyst),V(V+), if(V(in+_,in-_)<-V(hyst),V(0),V(out))) tripdv=0.01 tripdt=1p
R2 V+ 0 1G
R3 in+_ N003 500
R4 in-_ N004 500
C3 in+_ 0 1p
C4 in-_ 0 1p
R5 0 Hyst 1G
R6 Cout N002 10m
C5 Cout 0 100p
E1 Out 0 Cout 0 1
E2 N003 0 in+ 0 1
E3 N004 0 in- 0 1
B4 N001 0 V=if(V(Out)<1,V(V+),V(0)) tripdv=0.01 tripdt=1p
R7 CoutB N001 10m
C6 CoutB 0 100p
E4 OutB 0 CoutB 0 1
R8 in+_ in-_ 10G
R9 in- 0 10G
R10 in+ 0 10G
V5 V+ 0 5V
.ic v(c1) =0
.model OSC SW(Ron=1 Roff=10G Vt=.5 Vh=-.2)
.ic V(Cout) = 0
.ic V(in+_) = 0
.ic V(in-_) = 0
.ic V(CoutB) = 0
.ends OSC_test
When the oscillator is in one block, it suddenly doesn't work by the same way as the schematic.
Is there any possibility how to share my files sub, asy and asc for reviewing?
.asc
and.asy
files as a code block, similar to how I did with your.sub
file. \$\endgroup\$u
instead ofµ
. \$\endgroup\$