Hi! I am using ARDUINO NANO with ATmega168PA microprocessor. I am now taking oscillograms through the ATmega168PA ADC. I read various literature on this topic, but did not find the answer to my question. The fact is that I noticed that oscillograms of different shapes are shown on my DSO150 oscilloscope and in the EXCEL table (the data is transferred to EXCEL from ARDUINO NANO via the COM port). I am attaching an PDF file to my theme. PLX-DAQ_for_forum.pdf (204.5 KB)
I also attach a photo of the waveform on my FNIRSI DSO 150 oscilloscope.
Which Arduino pin is connected to the oscilloscope ?
Are you expecting that a reading from the ADC is somehow going to condition the output which you see on the oscilloscope ?
You don't appear to be guarding against overflows :
I am using pin A0 for ADC.
I want my Arduino Nano with the ATmega168PA microcontroller to give the same waveform in shape and values as my oscilloscope.
Yes, I don't overflow the i variable. This variable is used to output data to the values[ ] array.
OK. You have then an external signal generator creating a wave form.
You are simultaneously displaying that wave form on your oscilloscope and feeding it into analog pin A0 in your Nano (Atmega168).
You are sampling that waveform on the Nano (taking 100 samples) and plotting the results using a plotting program.
You are puzzled that the graph so plotted does not match the trace on the oscilloscope.
Is that more or less it ?
Show the connection (circuit) between the signal generator and the scope/nano. Say also what sort of signal it is. To me it looks a bit like the top half of a sine wave missing the negative component.
In this circuit the diode presents a high impedance to discharging the parasitic capacitance on the A0 input pin. Try the circuit with a 10k Ohm resistor added between A0 and GND.