Skip to main content
mani s
Associate III
October 4, 2018
Solved

How can i set vref of DAC to some voltage,say 3.2v and that voltage should give to BJT ?stm32f413zh mcu

  • October 4, 2018
  • 5 replies
  • 1023 views

Im using stn32f413zh nucleo board.

I want to voltage to BJT from stm32 using DAC ,how can i do it or what to configure?

please any thoughts.

This topic has been closed for replies.
Best answer by AvaTar

IMHO is a common abbreviation for "in my humble opinion".

> how can is use op-amp for this?

A simple inverting or non-inverting DC amplifier. There are plenty of opamp tutorials and example schematics available. Just taylor for your needs.

Just mind the offset voltage of the DAC when the output buffer is enabled (up to 200mV).

5 replies

AvaTar
Senior III
October 4, 2018

IMHO not a good idea.

Besides the highly non-linear Ib/Ic transfer function, the output impedance of the DAC is hardly sufficient to drive a BJT, even with enabled buffer.

A power opamp (or audio amplifier) would be an alternative.

mani s
mani sAuthor
Associate III
October 4, 2018

thank you for reply ,what is IMHO and how can is use op-amp for this?

AvaTar
AvaTarBest answer
Senior III
October 4, 2018

IMHO is a common abbreviation for "in my humble opinion".

> how can is use op-amp for this?

A simple inverting or non-inverting DC amplifier. There are plenty of opamp tutorials and example schematics available. Just taylor for your needs.

Just mind the offset voltage of the DAC when the output buffer is enabled (up to 200mV).

mani s
mani sAuthor
Associate III
October 4, 2018

1.yeah i will try to implement using op-amp,

2.is that below two lines is enough to set vref voltage for DAC, is im selecting channel

HAL_DAC_SetValue(&hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, 2048); 

HAL_DAC_Start(&hdac, DAC_CHANNEL_1); 

if not what and all shall i configure ?

mani s
mani sAuthor
Associate III
October 5, 2018

above two lines of code is correct or i have to add any registers for Dac in stm32f4 seires?