High frequency pulse with arduino uno - Page 1
Forum section: electronics / general

author: rauldm
author_rank: Regular Contributor
timestamp: August 04, 2021, 04:49:53 am
content: Few days ago, I found a post for work with high frequency pulses with arduino, I found a next code that can generate a 4 MHz pulse waveform, most interesanting thing was the performance, can reach 4.3 ns of rise time, I attach oscilloscope capture, I measure with tektronix 500 MHz passive probes. I hope this can works for someone that just needs low rise time pulse. This rise time is better even than SDG 2042x waveform generator or the agilent 33120a.Regards-.

author: rauldm
author_rank: Regular Contributor
timestamp: August 04, 2021, 04:50:26 am
content: Code:#include <TimerHelpers.h>// Timer 0// output OC0B pin 11 (D5)const byte timer0OutputB = 5;void setup() {pinMode (timer0OutputB, OUTPUT);TIMSK0 = 0; // no interruptsTimer0::setMode (7, Timer0::PRESCALE_1, Timer0::CLEAR_B_ON_COMPARE);OCR0A = 3; // count to 4, zero-relativeOCR0B = 1; // duty cycle} // end of setupvoid loop() {}

author: jenniferkim
author_rank: Contributor
timestamp: August 05, 2021, 01:29:03 am
content: You have checked the frequency of the PWM pulse? This code doesn't look like one to generate a pulse of 500MHz.

author: Bassman59
author_rank: Super Contributor
timestamp: August 05, 2021, 03:19:10 am
content: Quote from: jenniferkim on August 05, 2021, 01:29:03 amHis post is clear: it's a 4 MHz pulse with 4.3 ns rise time.It's not a 500 MHz pulse.You are confusing rise time with pulse frequency. They are independent parameters.Rise time is purely a function of the output driver in the chip. I'm not surprised that an Arduino has a 4.3 ns rise time. That's nothing spectacular.

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 05, 2021, 05:25:12 pm
content: Quote from: Bassman59 on August 05, 2021, 03:19:10 amYeah. Especially if the IO is only loaded with a high-impedance load such as a scope probe. Now try loading it a bit more and see what you get. Chances are, discrete logic gates - not even the fast ones - such as in the 74LVC series have shorter rise time than this kind of MCU (which I assume is an ATMEGA?) with any "significant" load.As to rise time being shorter than a typical signal generator generating a square wave, it's to be expected. Digital arbitrary waveform generators use DACs to generate a given signal. You'll never get as short a rise time as with even a cheap logic gate. That's not what they are meant for.

author: rauldm
author_rank: Regular Contributor
timestamp: August 09, 2021, 07:53:50 pm
content: Many users of signal generator is happy with with rise time performance these equipments, I show like a simple arduino can do better rise time, I have seen some waveform generator with specific hardware for this.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 09, 2021, 09:39:15 pm
content: Yup! This is typical of 74HC to LVC family pin drivers, and whatever equivalent is used in most MCUs, ASICs, etc. Even a 5V ATMEGA is fast enough to cause signal quality issues on loose jumper wires and breadboards; I've demonstrated this myself with an external ADC (via SPI), for which I had to add ferrite beads to the wires.Tim