Dealing with DAC powering on in zero voltage state - Page 1
Forum section: electronics / beginners

author: pman92
author_rank: Contributor
timestamp: May 15, 2023, 10:09:49 am
content: Hey guys,I'm working on a project that uses a microcontroller and a DAC to generate/simulate some signal voltages for an automotive ECU.The project is fitted in place of a 5v sensor, and powered directly from the 5v reference voltage outputted by the ECU. It then uses the DAC to output a signal voltage which is sent back to the ECU.Everything is working great, except 1 problem: When the ECU switches the 5v circuit on, it takes about 6ms before the microcontroller has booted up and sent the first SPI command to the DAC for it to begin putting out a proper voltage. In this short time before that has happened, the DAC has powered on and defaulted to a zero-voltage output state. Zero volts is out of range of the signal voltages that are required, the default voltage needs to be 0.5v.The ECU is sampling this zero voltage before the microcontroller gets a chance to set everything up, and applying a "correction" to the signal that then essentially puts the rest of the voltages 0.5V off until the next power cycle.Tried using a voltage divider to create the default signal voltage, however the DAC doesn't boot into a high-Z state. Its boots into a zero-voltage output. So it doesn't work.It seems most DACs boot in a zero-voltage state.I'm considering using a P channel MOSFET to isolate the DAC output, and using a voltage divider to create the default 0.5v output.Once the microcontroller has booted it can ground the gate of the MOSFET, connecting the DAC (on the Source) to the output (the Drain) using the MOSFET, and the DAC will take control of the voltage.The DAC output will never be below 0.5v, however this still requires that the MOSFET will be turned on with a gate to source (Vgs) as low as 0.5v.Most MOSFET data sheets I can find seem to list the Vgs threshold voltage around 0.5 to 1v - too high to guarantee the mosfet will actually switch on.Is there a MOSFET that has a Vgs threshold of 0.5v or less?Is there a better way of dealing with this problem?I also considered using a MOSFET to power the DAC's - but that still leaves time between them switching on and the first SPI communication when they will still default to 0v.Thanks in advance

author: pman92
author_rank: Contributor
timestamp: May 15, 2023, 10:55:56 am
content: After some searching on google, I think I might have a solution.Luckily the output signal voltage will never need to be higher than 3v in this application.I could use an N channel MOSFET as a high side switch to connect the DAC instead of a P channel.Since the microcontroller is operating on 5v, and I will never need to exceed 3v, I can maintain 2v gate-source voltage (Vgs). The mosfet will stay conducting.

author: David Hess
author_rank: Super Contributor
timestamp: May 15, 2023, 04:53:48 pm
content: Alternatives I would consider include using a multiplexer at the DAC output to select a 0.5 volt source on reset or startup, and then using an I/O pin to switch to the DAC output after the DAC has been set by the microcontroller. Of if the output never needs to go below 0.5 volts, I might using a summing amplifier or other circuit configuration to add 0.5 volts to the output of the DAC. Using an operational amplifier to convert the DAC output of 0 to 5 volts to 0.5 to 3 volts is not difficult.

author: langwadt
author_rank: Super Contributor
timestamp: May 15, 2023, 05:51:36 pm
content: a voltage divider might work, e.g. 9k from 5V to output, 1k from DAC to output

author: pman92
author_rank: Contributor
timestamp: May 16, 2023, 10:53:46 am
content: Thanks for the ideas guys.Quote from: langwadt on May 15, 2023, 05:51:36 pmThis is exactly what I ended up going with for now. I've tested like this and it seems to be working fine.1. Minimal hardware changes are required, and the software changes are very easy to implement too.2. The voltage at boot up will be exactly the same as the voltage when I command the DAC to be at its "rest" position. IE. there will be no difference between the 0.5v from a divider, and the 0.5v commanded by the DAC (if I was switching between 2 separate sources with a multiplexer for example).I might use a summing amplifier in the future if I ever want to make some more serious hardware changesThanks again!

author: ifrythings
author_rank: Contributor
timestamp: May 16, 2023, 02:35:55 pm
content: I did something similar for a throttle pedal converter for a ecm, I used a mcp4725 as it has a built in eeprom that you can program so when it first turns on it will output whatever voltage you want till the mcu boots and takes over.With a throttle pedal being out of spec when the ecm checks it will generally set codes and depending on ECM programming, some will lock out the throttle till the key is cycled which just repeats the cycle as the DAC boots to 0v, with the mcp4725 being programmable has eliminated this issue.