cancel
Showing results for 
Search instead for 
Did you mean: 

dac & adc with stm32cubemx and keil

meriarajagukguk
Visitor

I have a project using nucleo stm32f334.
With the way it works
I get the adc value from the 12 bit potentiometer. Then I want to display the value using dac and see the frequency, period and voltage from the oscilloscope.
I want the magnitude of the frequency of 200 hz with the period as fast as possible. I have used the formula to find the frequency, namely
f = CLOCK SOURCE / ((prescaler + 1) x (period + 1)) but the frequency produced by the oscilloscope is not 200 hz but between 35-40 hz.
I want to ask, are there other factors that I should calculate, or is there any influence from the clock configuration on stm32cubeMX?
Please help me, I really need your direction and help. Does anyone have a sample program or can anyone explain how I do it so that I don't get lost working on it? Thank you.

4 REPLIES 4
Andrew Neil
Evangelist III

@meriarajagukguk wrote:

I get the adc value from the 12 bit potentiometer. Then I want to display the value using dac and see the frequency, period and voltage from the oscilloscope.


This doesn't really make sense - what do you mean by frequency & period of a potentiometer?

 

okay let me explain again yes I have a project to create a company's goods QC.
I don't know for sure what the stages are because I'm still a beginner. So I learned to use nucleo stm32f334.
The first step I did was to find the adc value from the potentiometer and use the dac to output a sine signal. well I was given a range for the frequency used is 200 hz.
But with the formula f = clock source / ((prescaler + 1) x (period + 1)) the frequency produced on the oscilloscope is in the range of 35-40 hz. Not according to what I want even though I have used the equation above. With stm32f334 is there any input to get 200hz results??
I also want to ask if my steps are correct? And I want to ask if I want to use the ADC value for the DAC is there a tutorial or simple example for my project.
I'm a beginner and honestly I'm also confused.


@meriarajagukguk wrote:

 I have a project to create a company's goods QC ...  I'm still a beginner. 


This company is relying on a novice for their Quality Control system?!

Do you not have colleagues/tutors/supervisors who can help you with this?

 


@meriarajagukguk wrote:

The first step I did was to find the adc value from the potentiometer and use the dac to output a sine signal.


So the value read from the potentiometer is supposed to set the frequency of the sinewave output from the DAC?