KiCad 10.0.4 74HC163 simulation

Thread Starter

Dave Lowther

Joined Sep 8, 2016
337
I'm new to using simulators. I thought I'd give KiCad simulation a try as I've been using KiCad for several years. The issue I'm having is that the Q outputs of the 74HC163 start low, as intended, but immediately go to half Vcc, which AI told me was an undefined state, indicating that the model was misbehaving in some way.

I spent most of yesterday reading FAQs, looking for tutorials, and having a dialogue with Google AI mode. The AI seemed promising to start with, but after a few hours it started contradicting itself and many of its suggestions caused simulation errors. The AI was very definite about what was going wrong and what I should do that would fix it. That was until I said I'd had enough of trying 20+ changes none of which got the 74HC163 working and some made it worse, at which point it apologised for guessing and getting me to do trial and error changes :-(

I got the 74HC library from https://github.com/kicad-spice-library/KiCad-Spice-Library/blob/master/Models/Digital Logic/74HC.LIB
I designed the schematic myself. At one point I had !PE connected to reset, but edited it to be tied up at one point due to AI asking me to try it and see if there was a problem in the model associated with PE, I forgot to revert that. AI also suggested using a pull down between the junctions of pins 3 to 6 and 0V, which didn't fix the problem, so I reverted that.

1784041528764.png

With the help of AI I got the 74HC14 section working. I needed to add the pull downs on the outputs to make it work. So I added the same pull downs on the 74HC163 Q outputs.

1784041649716.png

1784042270298.png

It won't let me set pin 16 to Not Connected.

It would be greatly appreciated if someone could give me some help with getting this working. I.E. getting the 74HC163 Q outputs counting. Or perhaps tell me I'm wasting my time using KiCad for digital simulation and suggest a known working alternative, bearing in mind that I really want to do the schematic and board layout in KiCad, and prefer not to learn another schematic entry tool.

I was in two minds about whether to post here or post in the KiCad forum. I plumped for here because I see frequent posts on this forum from people who seem to be very knowledgeable about LTspice. IDK how similar that is to the ngspice that KiCad uses.
 
You shouldn't need any resistors other than R1, together with C1, both of which could be increased in value to give a longer reset pulse, in case the supply takes longer to stabilise. Everything looks as if it should work in reality, but 1k pulldowns on the outputs of the counter aren't needed. Pin 16 is the supply pin, so must be connected, as must pin 8 to Gnd.
 

Thread Starter

Dave Lowther

Joined Sep 8, 2016
337
Thank you for replying.
You shouldn't need any resistors other than R1
Just to demonstrate what happens without one of the pull downs, I moved R6
1784044510773.png
And then it doesn't plot anything for "reset".
1784044708696.png
I realise the pull downs aren't required in real life. IIRC AI said something like "pull downs are needed to make digital outputs plottable". The 5V (blue line at the top on this screen snip) looks stable from time 0.
The reset signal (in the first simulation output screen shot) should be long enough as there are two rising clock edges whilst reset is low.
There aren't any options for Vcc or Gnd in the model pin mapping drop down
1784045127038.png

The model text is attached. I've not yet studied the modelling language. I'm attaching it in case it's required for further diagnosis of this problem.
 

Attachments

sarahMCML

Joined May 11, 2019
703
Thank you for replying.

Just to demonstrate what happens without one of the pull downs, I moved R6
View attachment 369513
And then it doesn't plot anything for "reset".
View attachment 369515
I realise the pull downs aren't required in real life. IIRC AI said something like "pull downs are needed to make digital outputs plottable". The 5V (blue line at the top on this screen snip) looks stable from time 0.
The reset signal (in the first simulation output screen shot) should be long enough as there are two rising clock edges whilst reset is low.
There aren't any options for Vcc or Gnd in the model pin mapping drop down
View attachment 369516

The model text is attached. I've not yet studied the modelling language. I'm attaching it in case it's required for further diagnosis of this problem.
Very strange. Now I know why I never use simulators, only breadboard hardware!
 

Thread Starter

Dave Lowther

Joined Sep 8, 2016
337
are the voltages from Q1, Q2 Q3 also like that? there are only two possibilities, must be a bad model or bug in Sim..
Yes all 4 are the same. The simulator text window in post #1 shows the initial condition for all the Q outputs is 0. They all immediately jump to 1/2 Vcc, which AFAIK means "invalid or unknown state"
I was concerned that there might a 3rd possibility, user ignorance. E.G. I didn't know to start with that I couldn't just simulate a real world schematic with no pull downs.
I think I got the 74HC library from a reputable source. If you happen to know where I can get some other 74HC163 model that's known to work I'll give that a try to eliminate the bad model possibility.
 

Thread Starter

Dave Lowther

Joined Sep 8, 2016
337
I never use simulators, only breadboard hardware!
Me too, until now. I'm helping a relative beginner who wants to simulate a relatively complex (maybe 100 chips) system designed with 74HC. So I thought I'd just simulate a small simple part of it in KiCad to get started. So far it's been a bit of a disappointment, but I'm not giving up yet. That's why I posted here, in the hope of being told what I'm doing wrong, or to be told trying to simulate 74HC with KiCad is a waste of time.
 
Top