0

I have developed a circuit to process the PMT pulse output. For the testing, I need an artificial signal which is similar to the PMT pulse. How can I use AnalogWrite() to create such type of signal?

Attached image show the waveform of PMT Pulse

ocrdu
  • 1,775
  • 3
  • 11
  • 24
  • Do you mean you are looking for a way to generate a pulse as in the picture? The pulse is 40 ns. The Arduino AVR family of boards will have a hard time doing that! – Mikael Patel Mar 23 '19 at 15:16
  • Or do you mean a cascade of pulses with random width, duration and delay? All in the range of micro-seconds. – Mikael Patel Mar 23 '19 at 15:31
  • The PWM frequency of Arduinoboards is normally 490Hz, that means the shortest puls using analogWrite(PIN, 1) would last 8000ns. – RJPlog Mar 23 '19 at 15:50
  • You could write 200 NOPs @ 62.5ns each, assuming a 16MHz clock (minus overheads) – Zunzulla alagaty Mar 23 '19 at 17:57

2 Answers2

0

Short answer: You can't.

The Arduino can't do analog output at all, much less matching a specific analog waveform of ≈40ns duration.

PWM on the Arduino simulates constant analog voltages using square wave pulses of variable duty cycle. It has no support for creating analog waveforms of any type, much less ones with such a short duration.

EDIT

As mentioned in this thread: Generate a ramp input with an Arduino Uno

You could use a resistor ladder to create a roll-your-own DAC, and then use direct port register manipulation (not digitalWrite) to set the pins controlling your resistor ladder and get a crude approximation of your waveform.

Edit #2

There is no way you'll be able to generate nanosecond scale waveforms with a normal Arduino. It just isn't fast enough.

Duncan C
  • 5,682
  • 3
  • 17
  • 29
0

I doubt very much AVR-based Arduinos could do that.

SAMD21-based Arduinos do have a DAC, but their conversion time is about 2.85 μs. Their timer/counters can be clocked at 96 MHz, so about 10.5 ns/tick, but would yield a square pulse (that may or may not degenerate into what you need 8-).

Overall, I don't think an Arduino is the right tool for the job. Maybe something like the (very fast) Teensy 4.0 could do it, but I don't know much about those.

ocrdu
  • 1,775
  • 3
  • 11
  • 24