Electronics > Microcontrollers

High frequency pulse with arduino uno

(1/2) > >>

rauldm:
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-.

rauldm:

--- Code: ---#include <TimerHelpers.h>

// Timer 0

// output    OC0B   pin 11  (D5)

const byte timer0OutputB = 5;
 
void setup() {
   pinMode (timer0OutputB, OUTPUT);
   TIMSK0 = 0;  // no interrupts
   Timer0::setMode (7, Timer0::PRESCALE_1, Timer0::CLEAR_B_ON_COMPARE);
   OCR0A = 3;   // count to 4, zero-relative
   OCR0B = 1;   // duty cycle
}  // end of setup

void loop() {}
--- End code ---

jenniferkim:
You have checked the frequency of the PWM pulse? This code doesn't look like one to generate a pulse of 500MHz.  :-//

Bassman59:

--- Quote from: jenniferkim on August 05, 2021, 01:29:03 am ---You have checked the frequency of the PWM pulse? This code doesn't look like one to generate a pulse of 500MHz.  :-//

--- End quote ---

His 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.

SiliconWizard:

--- Quote from: Bassman59 on August 05, 2021, 03:19:10 am ---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.

--- End quote ---

Yeah. 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.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version