Simulating serial communication in ngspice
Most systems today involve both analog and digital components, and digital components in a lot of cases would be communicating with each other via some form of serial communication interface (I2C, UART, SPI or any other). In such a scenario it might be useful to have a way to simulate these communications. In this post I will be explaining an example of an ADC over SPI interface. For reference I will be taking the example of ADC081S021 which is an 8-bit analog to digital converter by Texas instruments. For simulation I will be using ngspice as a circuit simulator. Ngspice is an open source circuit simulation which allows you to build custom models of a device using the XSPICE extension. (for more details on ngspice and xspice checkout the ngspice page and user manual ). Functional details of the ADC. In this section I will be describing the details of the ADC and its communication protocol. For reference look at the figure below, it describes the timing of adc...