cancel
Showing results for 
Search instead for 
Did you mean: 

Why all the routines, to handle the DAC output, in the STM32Fxxx_nucleo_ihm08m1 are without code (completely empty)? i.e void START_DAC() { }, void STOP_DAC() { }, void SET_DAC_value(uint16_t dac_value) { }

RStef.2
Associate

The 6.2 paragraph of document DocID029868 (Rev. 2), page 34, appears to be reporting incorrect information.

Furthermore, pin PA4 seems to be connected to the speed reference (potentiometer) not to one of the DAC outputs as reported in the mentioned document.

I'm using ihm08m1 board with nucleo-F401re.

1 ACCEPTED SOLUTION

Accepted Solutions
Dario CUCCHI
ST Employee

Hi @RStef.2​ ,

The DAC peripheral is not available in the STM32F401RE, this is the reason why the DAC routines are empty.

These functions are not empty in the example with the NUCLEO-F302R8 instead.

To emulate the DAC functionality you can use a timer generating a square wave and change its duty cycle.

Low-pass filtering this signal provides an analog voltage between 0V and 3.3V proportional to the duty cycle.

By default the PA4 is connected to the potentiometer. If you want to use PA4 as a DAC purposes

you can disconnect R181 and connect R76 so you can have the line mapped on the connector J7 and on the current REF net.

Have a nice day !

View solution in original post

1 REPLY 1
Dario CUCCHI
ST Employee

Hi @RStef.2​ ,

The DAC peripheral is not available in the STM32F401RE, this is the reason why the DAC routines are empty.

These functions are not empty in the example with the NUCLEO-F302R8 instead.

To emulate the DAC functionality you can use a timer generating a square wave and change its duty cycle.

Low-pass filtering this signal provides an analog voltage between 0V and 3.3V proportional to the duty cycle.

By default the PA4 is connected to the potentiometer. If you want to use PA4 as a DAC purposes

you can disconnect R181 and connect R76 so you can have the line mapped on the connector J7 and on the current REF net.

Have a nice day !