Beginner Tutorial for QSpice (Community Sharing)

6. DLL Block (C++ Block), Ø-Device
One of the most important features of QSpice is the Ø-Device (DLL block or C++ block). You can implement sophisticated control algorithms with it. Here is the basic workflow for creating a Ø-Device. This example is an ADC with an external, level-triggered clock.

07-CreateDLLBlock

However, in general, ADC triggering occurs at the rising edge of the clock. This is done by using an instance variable to store the previous clock state so that the update is only triggered on the clock edge.

07-DLLBlock.qsch (2.2 KB)
adc.cpp (4.2 KB)
07-CreateDLLBlock-EdgeTrigger

If you need more information about the DLL block, go to my GitHub and download the Device Guideline. There is a section explaining the Ø-Device; to master it, you must also learn concepts such as the trunc() function in the DLL template for the use of TTOL, etc.

@RDunn and I worked on a complete tutorial for implementing a digital PID controller. If you plan to work with DLL blocks, I highly recommend studying this project, as we not only upload the code but also a pdf explanation document.
C++ PID Controller for Qspice (Community Project) - QSPICE - Qorvo Tech Forum

4 Likes