How to simulate an ADC in QSPICE using C++

Пікірлер: 18

  • @CallistoPili
    @CallistoPili11 ай бұрын

    the bonus point of Qspice is the mixed signal simulation with Verilog and C/C++. which can make feasible to integrate a plethora of libraries and models compiled by external parties.

  • @xristost68
    @xristost6811 ай бұрын

    Why the output is in kiloVolts?

  • @engineeringhustle

    @engineeringhustle

    11 ай бұрын

    The output is what would normally be the internal microcontroller output from an ADC. For a 12-bit ADC the values can range from 0 to 4095, therefore it appears as kiloVolts in this demonstration.

  • @SomeTechGuy666
    @SomeTechGuy66610 ай бұрын

    Thanks for the demo ! Do you know if one could do this in ngspice ?

  • @engineeringhustle

    @engineeringhustle

    9 ай бұрын

    I believe it’s possible. However, it’s definitely more work to get it running than in QSpice.

  • @CallistoPili
    @CallistoPili11 ай бұрын

    Qspice cannot run on Linux, I tried to hack the binary to bypass some checks to be able to run within Wine but i stopped frustrated. any solution?

  • @engineeringhustle

    @engineeringhustle

    11 ай бұрын

    Since I’m only using Windows I unfortunately don’t know any work around to get it running on Linux.

  • @batishchev

    @batishchev

    10 ай бұрын

    I have one version running under Win7, one under Win10 and one under Wine Ubuntu. Works under Wine when compatibility mode is set with the winecfg option: Staging - check Hide Wine version from applications

  • @CallistoPili

    @CallistoPili

    10 ай бұрын

    @@batishchev i will check. the trouble initally was the 'compatibility' during the installation which fails recognizing the 64bit OS and 'blocked' with Windows 10 not detected.

  • @batishchev

    @batishchev

    10 ай бұрын

    According to your method, you also need to unlock the QUX.exe file

  • @irgski
    @irgski11 ай бұрын

    Isn’t this an AtoA converter? ;-)

  • @engineeringhustle

    @engineeringhustle

    11 ай бұрын

    In this example the output is only there for demonstration purposes. It does however convert the analog input into an integer. For the defined 12-bits the input value is converted to a range from 0 to 4095.

  • @sc0or
    @sc0or11 ай бұрын

    cmon, an ADC has a digital serial (in most cases) out, not a discrete analog voltage

  • @engineeringhustle

    @engineeringhustle

    11 ай бұрын

    You‘re 100% right. However, here it was just for demonstration purposes. The idea is more to use the simple code of the ADC input as a modulation of a microcontroller ADC and then further process it internally before providing an output through different peripherals.

  • @sc0or

    @sc0or

    11 ай бұрын

    @@engineeringhustleI supposed this ) Just found out this new great software recently, and I was really impressed how easy many things can be made with it.

  • @ttkoh123
    @ttkoh1239 ай бұрын

    It would be better described as simulate ADC sampling and not ADC per se, I think and the voltage sampled cannot be in KV, right? kzread.info/dash/bejne/X5WNztCrn7qrk7w.html

  • @engineeringhustle

    @engineeringhustle

    8 ай бұрын

    Maybe modeling an ADC in C would better describe what is shown in this video. The voltage in kV just shows the internal value you get from an ADC conversion within a microcontroller. This output is just there for demonstration.

  • @ttkoh123

    @ttkoh123

    8 ай бұрын

    @@engineeringhustle Successive Approximation (SAR) ADC? Delta-sigma (ΔΣ) ADC? Dual Slope ADC? etc?