2015-07-08 10:07 AM
Hi, I have got the need to track a continuously changing value and I had the idea to use D/A conversion to convert my variable into a voltage and track it with an oscilloscope or even voltmeter.
Which should this be done, can a digital value be written to the DAC and then the voltage read on some pin? Or alternatively, is it possible to use a GPIO pin with the GPIO_MODE_ANALOG set for this? #stm32f3 #gyroscope #l3gd20 #stm32f3 #dac #gpio2015-07-08 10:50 AM
You could use the DAC to generate a voltage between 0-Vref
You could use the ADC to measure a voltage between 0-Vref From your question I'm assuming to want to track an internal variable (12-bit value, or scaled to that extent), via an external pin. If you used two DAC pins you could drive the X/Y of the scope, and scan several values.2015-07-08 12:24 PM
Hi, yes I want to track an internal value and yes I intend to scale it to fit.
TheSTM32Cube_FW_F3_V1.1.0
software doesn't have an example for this for STM32F3-Discovery, but at least it's doable. Thanks, that's the approach I'll use. Adam2015-07-08 02:05 PM
The SPL has some
STM32F3-Discovery_FW_V1.0.0\Project\Peripheral_Examples\DMA_RAM_DACSTM32F30x_DSP_StdPeriph_Lib_V1.0.0\Project\STM32F30x_StdPeriph_Examples\DAC\DAC_SignalsGeneration2015-07-09 10:31 AM
Thanks, I have something rudimentary working now.
I found the step-by-step-instruction in stm32f3xx_hal_dac_ex.c of the STM32Cube HAL library quite helpful too.2015-07-13 08:54 AM
Using a D/A the converter I am now able to monitor the gyroscope rotational accelration around the x axis as a voltage.
I run the gyroscope at 190 Hz rate and read the oscilloscope in a thread every time the the DRDY interrupt gives a semaphore. When the STM32F3-Discovery board is placed on a desk, the output is about 4500 mdps (milli degrees per second) velocity around the x axis. This is within the specified zero-rate level in the L3GD20 specification pdf, which says I can expect +- 15 dps. No surprise there. I take 3000 samples (which takes about 15s) to get rid of the offset, but even then the D/A converter shows that the zero-rate level keeps drifting. The L3GD20 Data Sheet doesn't say anything about a settling time, so I wonder what experiences others have had?