Dlloydev / Wokwi-Chip-Scope

This 4 channel scope chip allows you to monitor four analog or digital signals as they vary over time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wokwi-Chip-Scope

Description

This 4 channel scope chip allows you to graph four analog or digital signals as they vary over time.

  • Scope Sample Time μs range is 0µs to 400µs

  • Scope Sample Time ms range is 0ms to 40ms .

  • Width of plot is 250 samples.

  • Trigger Channel selector (0-3) for analog or digital signals, default 0

  • Trigger modes are Off (0) Rising (default) ⬆ and Falling ⬇

  • Displays analog voltsVmax, and volts Vmin

  • Displays Sample Raye S/s and Capture Time ms

  • Displays Trigger Channel selection >

  • Displays Frequency Hz and Duty of digital signals

  • Default control settings (below) can be changed in diagram.json

          "attrs": {
            "sampleTimeUs": "100",
            "sampleTimeMs": "0",
            "triggerChannel": "0",
            "triggerMode": "1",
            "crtColor": "0",
            "trace0Color": "14",
            "trace1Color": "12",
            "trace2Color": "10",
            "trace3Color": "2"
          }

    image

image

Name Description
D0, D1, D2, D3 Digital INPUTs, located on left side of the chip.
A0, A1, A2, A3 Analog INPUTs, located on right side of the chip.

If both a digital and analog signal are connected for the same channel, then the analog signal will be shown on the screen if any analog voltage is detected. In this case, the minimum volts may start at 1.0V due to activity of the digital signal. If the analog signal is set to 0.0 volts, then the digital signal will be shown.

For digital signals, the frequency (Hz) and duty (%) is calculated for the selected channel for trigger. Just select each channel for trigger to lock in on its signal and display the calculated parameters.

In the image above, D0 is selected for trigger shown by >. The analog voltage for the slide pot is not shown, as it is adjusted to minimum (0V). The signal generator is connected to A3 and the sine wave is displayed, If this analog signal is adjusted to 0.0 volts, then the waveform on channel D3 will be shown.

The colors available for crtColor are:

  1. black
  2. whiteGray
  3. darkGreen
  4. deepGreen
  5. darkBlue

The colors available for tracenColor are:

  1. black
  2. brown
  3. red
  4. orange
  5. gold
  6. green
  7. blue
  8. violet
  9. gray
  10. white
  11. cyan
  12. limeGreen
  13. magenta
  14. purple
  15. yellow

Usage

To use this chip in your project, include it as a dependency in your diagram.json file:

  "dependencies": {
    "chip-scope": "github:Dlloydev/Wokwi-Chip-scope@1.0.7"
  }

Then, add the chip to your circuit by adding a chip-scope item to the parts section of diagram.json:

  "parts": {
    ...,
    {
      "type": "chip-scope",
      "id": "scope1",
      "top": -100.0,
      "left": 100.0,
      "attrs": {
        "sampleTimeUs": "100",
        "sampleTimeMs": "0",
        "triggerChannel": "0",
        "triggerMode": "1",
        "crtColor": "0",
        "trace0Color": "14",
        "trace1Color": "12",
        "trace2Color": "10",
        "trace3Color": "2"
      }
    },

The actual source code for the chip lives in src/main.c, and the pins are described in chip.json.

Example

Wokwi_badge Graph four analog or digital signals as they vary over time.

License

This project is licensed under the MIT license. See the LICENSE file for more details.

About

This 4 channel scope chip allows you to monitor four analog or digital signals as they vary over time.

License:MIT License


Languages

Language:C 100.0%