jk flip flop for ltspice

Discussion in 'General Electronics Chat' started by brandonb, Dec 12, 2010.

  1. brandonb

    Thread Starter New Member

    Nov 14, 2010
    9
    0
    has anyone made a jk flipflop that works with ltspice?
     
  2. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    In the Digital Component selection window, there is the behavioral xjkflop. See the Help file under Special Functions for instructions on how to use behavioral digital components. Some of this is undocumented. Come back with any questions you have.
    In the CD4000 library, there is CD4027.
    In the 74HC library, there is 74HC107 and 74HC109. Also see the 74HCT library.
    See screen captures of these windows in the attachments below.
    The behavioral digital components are installed with LTspice when you first download it. If you don't have the other libraries, get them from the Yahoo LTspice group. You will have to join first.
     
    Last edited: Dec 12, 2010
  3. brandonb

    Thread Starter New Member

    Nov 14, 2010
    9
    0
    all i found was the icon- can you give me a link, i dropped it in the library folders like i did with wookies lm2907 file, i have an icon in the digital selection of my spice library but it doesnt work, unknown subcircuit messange.....i dont know how to find anything on the yahoo spice website
     
  4. brandonb

    Thread Starter New Member

    Nov 14, 2010
    9
    0
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Save CD4000.lib in your \Program Files\LTC\SwitcherCad\lib\sub directory.
    Download CD4000.zip.
    Unzip that file into \Program Files\LTC\SwitcherCad\lib\sym\CD4000

    I don't care to use those symbols with the .i, so I created a subdirectory .i, and moved all of those files into the .i subdirectory.

    Read the help.txt file.
    Download the 74HC files as well, and read the help.txt file for them.
     
  6. brandonb

    Thread Starter New Member

    Nov 14, 2010
    9
    0
    sarge i keep getting the unknown subcircuit message what am i doing wrong- it would be awsome if i could get this working as the 4000series are the components i use in my circuits
     
  7. brandonb

    Thread Starter New Member

    Nov 14, 2010
    9
    0
    sarge the deal about the subciruit cant be found message- i think it has to do with the 4000.lib file- i dropped it into the sub folder, but all the white pape icons say sub below them and the 4000.lib says lib....i tryed to open that file but its a document spreadsheet and cant drag- i cant seem to be able to post attachements or i would show you whats going on- thanks for helping me with this
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    That's odd.

    Perhaps your symbols don't have cd4000.lib on the ModelFile line in Attributes?

    Try adding a SPICE directive:
    .inc cd4000.lib
    in your schematic diagram. You can copy the above line, and paste it into a Spice directive box in LTSpice. You get the Spice directive box by clicking the .sp icon on the menu bar over on the right end.
     
  9. brandonb

    Thread Starter New Member

    Nov 14, 2010
    9
    0
    sarge- that worked- i add that directive to the diagram and all seems well- what does that mean if it works with spice directive only? huge thanks to you on that one and also to ron
     
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Brandonb,
    It means that the .asy files (symbols) don't have a ModelFile entry in their Attributes to tell LTSpice that they need to reference cd4000.lib in order to get the definitions for the sub-circuits (.SUBCKT ) and model (.MODEL) statements that describe how the part is supposed to work.

    The .inc cd4000.lib Spice directive tells LTSpice that in addition to whatever .sub and .lib files you're looking in for .MODELs and .SUBCKTs in, look in the cd4000.lib file, too.

    You can look at the .sub and .lib files using Notepad; they're just text files. The contents of .sub and .lib files look more or less like gibberish until you start going through the LTSpice Help file, and see what all that stuff means.

    Just don't change anything in those files until you're really certain of what you're doing, or you may cause some really odd errors to occur - or "break" it altogether.
     
  11. brandonb

    Thread Starter New Member

    Nov 14, 2010
    9
    0
    sarge- im gonna play it safe and use the spice directive on the 4000 library- is there anyway i can save that directive somewhere to copy it or save it in the spice program so i can run that directive when needed?
     
  12. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, if you wanted to take the time, you could edit each and every cd4xxx.sym (symbol) file, edit the attributes, and put cd4000.lib in the SpiceModel textbox.

    I suppose you could save a schematic (.asc) file named cd4000 that only had the
    .inc cd4000.lib
    directive, and load that file and save it as something else each time you wanted to use a 4000 series CMOS part.

    If you start using LTSpice pretty frequently, these kinds of things will sort of become 2nd nature to you. It might seem awkward at first, but once you get the basics down, it gets a good bit easier.
     
  13. brandonb

    Thread Starter New Member

    Nov 14, 2010
    9
    0
    thats a perfect idea with saving the directive on a blank screen- i never thought of that...
     
  14. frogndog

    New Member

    Jan 30, 2012
    2
    0
    Hi Ron
    I cannot access the xjkflop as it is not in my library, what can I do?
     
  15. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
  16. frogndog

    New Member

    Jan 30, 2012
    2
    0
    There is no mention of 'Special Functions' for behavioral components in my help file.
    I've noticed that your Top Directory looks like....
    C:\Program Files\LTC\SwCADIII\lib\sym\Digital\
    Wher as my Top Directory looks like...
    C:\Program Files\LTC\LTSpiceIV\lib\sym\Digital\
    Does this make any sense?
     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Look under "A. Special Functions" in the Help file.

    Linear Technology decided to rename the subdirectory from SwCADIII to LTSpiceIV when they went from version 3 to version 4. It doesn't really matter; you just go ahead with the latter name.
     
Loading...