|
1 | 1 | # discrete
|
2 | 2 | Development files for the simulation of discrete circuits in MAME.
|
3 | 3 |
|
4 |
| -The MAME emulation platform is capable of importing a number of different |
5 |
| -circuit design file formats. The open source suite, KiCAD: |
6 |
| -http://kicad-pcb.org/ |
| 4 | +The MAME emulation platform is capable of importing SPICE netlists which can be exported from the open source suite [KiCAD](http://kicad-pcb.org/) and the open source suite [gEDA](http://wiki.geda-project.org/). You may also be successful with [LTspice ](https://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.html). |
7 | 5 |
|
8 |
| -and the open source suite gEDA: |
9 |
| -http://wiki.geda-project.org/ |
| 6 | +This repository is meant to house files in formats that can be imported and worked with in netlist. |
10 | 7 |
|
11 |
| -are both currently supported. |
| 8 | +## KiCad |
12 | 9 |
|
13 |
| -This repository is meant to house files in at least these two formats that can |
14 |
| -be imported and worked with in MAME. |
| 10 | +### Prerequisites |
15 | 11 |
|
| 12 | +#### Install |
| 13 | +Going forward you will need at least KiCad 5.1. On Ubuntu you can install kicad using |
| 14 | + |
| 15 | +```sh |
16 | 16 | sudo add-apt-repository ppa:js-reynaud/kicad-5.1
|
17 | 17 | sudo apt-get update
|
| 18 | +sudo apt install kicad kicad-templates kicad-doc-en kicad-symbols kicad-footprints kicad-demos kicad-packages3d libngspice-kicad kicad-libraries |
| 19 | +``` |
| 20 | + |
| 21 | +#### Libraries |
| 22 | + |
| 23 | +Add `MAME.kib` and `netlist.lib` to your library list: |
| 24 | + |
| 25 | +Preferences-> Manage Symbol Libraries -> Add existing library |
| 26 | + |
| 27 | +### Status |
| 28 | + |
| 29 | +Project | Status |
| 30 | +------- | ------ |
| 31 | +carnival | TBD |
| 32 | +congoBongo | migrated to 5.1, WIP |
| 33 | +fantasy | TBD |
| 34 | +kidNiki | TBD |
| 35 | +monkeyMagic | TBD |
| 36 | +obxVoice | TBD |
| 37 | +tb303 | TBD |
| 38 | +carPolo | TBD |
| 39 | +StarCruiser | TBD |
| 40 | +wildfire | TBD |
| 41 | + |
| 42 | +### Specific components |
| 43 | + |
| 44 | +#### Diodes |
| 45 | + |
| 46 | +Spice and the nltool convert command expect diodes to be in the format |
| 47 | +``` |
| 48 | +D1 Anode Cathode Model |
| 49 | +``` |
| 50 | + |
| 51 | +Kicad however by default just maps pin 1 to Anode and pin 2 to Cathode. Unfortunately in Kicad pin 1 for diodes ins Cathode and pin 2 is Anode. |
| 52 | + |
| 53 | +`nltool -c convert` will currently automatically determine if a netlist is fed into it and take appropriate action. This will change in the future to have perfect integration with other netlist parsers. |
| 54 | + |
| 55 | +#### BJT Transistors |
| 56 | + |
| 57 | +The situation is comparable. BJTs have three pins and different assignments depending on the transistor you select. The SPICE default is |
| 58 | + |
| 59 | +``` |
| 60 | +Q1 Collector Basis Emitter Model |
| 61 | +``` |
| 62 | + |
| 63 | +To make sure pins are correctly mapped in the exported netlist, proceed as follows: |
| 64 | + |
| 65 | +- Add the BJT |
| 66 | +- Set value to model, e.g. B247C |
| 67 | +- Open symbol editor by double clicking on symbol |
| 68 | +- Click on `Edit Spice Model` |
| 69 | +- Tick `Alternate Node Sequence` and enter the value from the rightmost table column. |
| 70 | + |
| 71 | +C pin | B pin | E pin | Suffix | Spice_Node_Sequence | |
| 72 | +----- | ----- | ----- | ------ | ------------------- | |
| 73 | + 1 | 2 | 3 | CBE | | |
| 74 | + 1 | 3 | 2 | CEB | 1 3 2 | |
| 75 | + 2 | 1 | 3 | BCE | 2 1 3 | |
| 76 | + 2 | 3 | 1 | ECB | 2 3 1 | |
| 77 | + 3 | 1 | 2 | BEC | 3 1 2 | |
| 78 | + 3 | 2 | 1 | EBC | 3 2 1 | |
| 79 | + |
| 80 | +**Recommendation:** In the component editor tick `Show` in the `Spice_Node_Sequence` row. This will show the node sequence in the schematics editor. This will tell you immediately if you got it wrong and spare you hours of debugging. |
| 81 | + |
| 82 | +#### General devices |
| 83 | + |
| 84 | +Kicad comes with libraries for 74XX devices, 4XXX devices and opamps . If there are multiple components per package, all unused inputs must be connected to `GND` and all unneeded outputs must be marked as `NC`. For all packaged (DIP, ...) devices there is usually a separate component for power supply connection. Power supplies must be connect. |
| 85 | + |
| 86 | +#### ANALOG_INPUT device |
| 87 | + |
| 88 | +Special device for providing fixed voltage nets in netlist, e.g. +5V or +12V. This devices is provided by netlist.lib. Set value field to voltage. Don't change the reference prefix. ```netlist``` won't work without ```YA_``` |
| 89 | + |
| 90 | +#### TTL_INPUT device |
| 91 | + |
| 92 | +This device emulates logic inputs to the circuit with TTL level. This devices is provided by netlist.lib. Set value field to 1 (logic high) or 0 (logic low). Don't change the reference prefix. ```netlist``` won't work without ```YT_```. |
| 93 | + |
| 94 | +TTL_INPUT devices have 3 pins. Pin 1 is the logic output, pin 2 positive power supply (VCC) and pin 3 negative power supply (GND). |
| 95 | + |
| 96 | +### Converting to netlist |
| 97 | + |
| 98 | +```sh ./nltool -c convert -f /tmp/congoBongo.cir > nl_congo_bongo.cpp``` |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
18 | 104 |
|
0 commit comments