Issues With ADC

Asked by Dragonleon
Mail bautistasantiago@yahoo.com
Location United States

Hardware: ATmega328P At 16MHz Software: C Project Atmel Studio 7.0

The program requires to read different frequencies from 1 2 3 Hz, when I put voltage 1 2 3 4 5 V [volts] but it does not work. in the oscilloscope. I do not know if the issue is with my atmega328p board or I miss something in the code. Always appear the frequency at 1.87kHz at any voltage like if it is not working the channel analog or ADC channel ADC1. I will appreciate a lot if you figure out the solution.
Thanks

Replies

are you trying to generate different frequencies (1,2,3,4 & 5) Hz when you input voltages of (1,2,3,4 & 5)?

This is what I understood from the code.

But you have written that "The program requires to read different frequencies..." that is confusing.

RDragonleon

2016-06-04 05:29:21

Yes, I need to get different frequencies when I input different voltages.

RAvinash

2016-06-08 13:42:23

Hello,

The proper method to generate waveform is to use the Compare module of the MCU. I have developed a code that can generate 1 Hz square wave signal on OC1A pin (PB1)(PIN 15 on 28 PIN DIP IC). The hex code is attached. Check it with your hardware and inform if you can successully get 1 HZ out.