1

Last year, I created a circuit simulator in C# based on Quics. I split the project into front-end (written in C# WPF) visual editor to create and edit the circuit elements, and back-end (written in C++) to do the matrix computations of the Modified nodal analysis. The connection is data driven through netlist file.

Now I'm considering adding AVR microcontroller simulation support that can interact with the rest of the elements in the circuit.

My problem is that I don't know how to do this in the current matrix formulation?

Note: What I want to achieve might be similar to this emulating 6502 of NES console. But the problem is I don't know how to emulate the IO's to work with the rest of the circuit.

SamGibson
  • 17,231
  • 5
  • 37
  • 58
Dr.MSM
  • 13
  • 2
  • 1
    Do you have an electronic or electrical engineering question? – Andy aka Jan 30 '20 at 15:56
  • i don't know if simulating electrical circuits fits in the category of electrical engineering . – Dr.MSM Jan 30 '20 at 15:59
  • I guess questions on how simulation models might work are probably good questions but I don't understand enough to help with matrix formulation relating to the emulation of IO. – Andy aka Jan 30 '20 at 16:05
  • Lets say you want to recreate SPICE or Protues from scratch ,I just cant find any thing on the internet about simulating microcontrollers in (signal integrity level) , maybe i lack some terminology about the subject @Andy aka – Dr.MSM Jan 30 '20 at 16:10
  • You're mainly just concerned about the IOs, not the internal functions? Or are you trying to create a complete model of the chip? – Justin Jan 30 '20 at 16:34
  • Just IO so that i can interface it with the rest of components, i dont want to emulate regesters and counters ,i want to represent the ROM as an array of bytes in c++ and parse it ,and regesters as varables . – Dr.MSM Jan 30 '20 at 16:39
  • I guess my question is, what is "it" that you are trying to interface with the components? What is on the inside of the IOs? Whatever that is will determine how you interact with it. If you want to co-simulate an AVR emulator, it will probably need some level of support built in. – Justin Jan 30 '20 at 16:42
  • After thinking about it for while ,i can actually represent pins as nodes in MNA and at every clock cycle , I can copy the values from pins array to nodes after multiplying by 5 to get right voltage – Dr.MSM Jan 30 '20 at 16:58
  • You can do that, but it won't be very accurate. You will have ignored the actual electrical behavior of the pins...voltage levels, current values, delay. – Elliot Alderson Jan 30 '20 at 17:02
  • Any suggestions?? – Dr.MSM Jan 30 '20 at 17:07
  • or intead of simple node i can create a network of resistors and capacitors to simulate out/in impedance of the pins @Elliot Alderson – Dr.MSM Jan 30 '20 at 17:15
  • But the input/output characteristics are not linear, they are governed by the behavior of MOSFETs. The industry standard approach for this is to use IBIS models. – Elliot Alderson Jan 30 '20 at 17:19
  • I heard about IBIS models,and i know that vendors supply these models,so i think i'll look for how to implement this for my case ,thanks @Elliot Alderson – Dr.MSM Jan 30 '20 at 17:26

1 Answers1

0

As @Elliot Alderson pointed out the comment below maybe i need to investigate IBIS models and try to implement that as proper way to acheive the mapping between the two different formulations.

Dr.MSM
  • 13
  • 2