F407 - Testing your DACs

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
Post Reply
User avatar
Pito
Posts: 1500
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

F407 - Testing your DACs

Post by Pito » Tue Jul 11, 2017 7:10 pm

This is an experimental bin with a TESTING tool for DACs, currently for F407.
Provided as-is, no warranties of any kind provided :)

Code: Select all

*** DAC 1 and 2 TESTING by Pito 7/2017 ***
*** STM32F407   DAC1 PA4    DAC2 PA5   ***
*** Offset/Gain DAC1 PA4 to ADC0 PA0   ***
*** Offset/Gain DAC2 PA5 to ADC1 PA1   ***
Usage:
   DAC> ref u[mV]
   DAC> buf 0/1
   DAC> dac 1/2 u[mV]
   DAC> offs 1/2 0/1
   DAC> gain 1/2 0/1
Example:
   DAC> ref 3299   --> set Vref to 3.299V
   DAC> buf 0      --> disable DAC buffer
   DAC> buf 1      --> enable DAC buffer
   DAC> dac 1 2800 --> set DAC1 to 2.800V
   DAC> dac 2 200  --> set DAC2 to 0.200V
   DAC> offs 1 0   --> offset DAC1 no -1 OPAMP
   DAC> offs 2 1   --> offset DAC2 w/ -1 OPAMP
   DAC> gain 1 0   --> gain   DAC1 no -1 OPAMP
   DAC> gain 2 1   --> gain   DAC2 w/ -1 OPAMP

DAC>
A session:

Code: Select all

DAC> ref 3299
REF 3299

DAC> dac 2 2000
DAC 2 2000

DAC> dac 1 100
DAC 1 100

DAC> offs 1 0
OFFS 1 0
2057.53
10.53
2057.43
Offset = 10.53003 units

DAC> offs 1 1
OFFS 1 1
2057.39
-10.39
2079.20
Offset = -10.38989 units

DAC> offs 2 0
OFFS 2 0
2045.82
-1.18
2045.72
Offset = -1.18005 units

DAC> offs 2 1
OFFS 2 1
2045.46
1.54
2042.05
Offset = 1.54004 units

DAC> gain 1 0
GAIN 1 0
1028.23
3084.42
Gain = 1.00400 units

DAC> gain 1 1
GAIN 1 1
1028.27
3084.53
Gain = -1.00403 units

DAC> gain 2 0
GAIN 2 0
1018.20
3072.17
Gain = 1.00292 units

DAC> gain 2 1
GAIN 2 1
1018.11
3072.11
Gain = -1.00293 units
Notes:
There are no checks on input values so use with care.
The default Vref is 3.3V.
Upon reset the DACs are set to zero.
When changing buffering the DACs are set to zero.
The unbuffered DAC1,2 output of F407/F103 is weak, 10k load will half the output voltage.
Therefore use 10megohm input impedance voltmeter when measuring the unbuffered DAC output.
The buffered output is much stronger, but you will loose bottom and top ~60mV range.
For measuring offset and gain (with -1 gain opmap connectected or without) you have to connect DACs to ADCs as
described in the splash screen. The measurements as described in http://www.st.com/content/ccc/resource/ ... 129215.pdf
Compiled for Black F407/VE/ZE @168MHz, SerialUSB.
DAC_F4.rar
(15.61 KiB) Downloaded 12 times
Pukao Hats Cleaning Services Ltd.

Post Reply