sinara-hw / Thermostat

2-channel temperature controller
5 stars 3 forks source link

#SHDN and FREQ signals need voltage level translator #110

Closed maciejprzybysz closed 2 years ago

maciejprzybysz commented 2 years ago

MAX1968 #SHDN and FREQ pins are driven from STM32 with 3V3 logic levels. MAX1968 Electrical Characteristics specify min. input high level voltage as Vdd x 0,75 and low level voltage as Vdd x 0,25. On Thermostat MAX1968 is powered from 5V, so low level voltage should be max. 1,25V and high lvl voltage min. 3,75V. I think we should add voltage level translator in the next revision.

2022-02-21_15h47_48

The same issue applies to all previous versions, but despite the difference in voltages, it has worked fine so far. Since release 2.2 additional 10k pulldown resistor R94 has been added to project (#94 ). This pulldown in combination with a 2k series resistor (R31 & R85) on the #SHDN line made a voltage divider and a high level voltage dropped below 3V. As a result, MAX1968 stopped turning on.

In 2.2.1 release we changed R94 resistor to 200k (we produced this version before finding the problem). This helps to prevent TEC driver turning on before system start and still allows the driver to be turned on by STM32. We made tests with 200k and 1M pulldown resistor in temperature range from 20°C to 80°C. Scopes from corner cases attached below.

RED: #SHDN with 1M pulldown YELLOW: TEC Voltage on channel with 1M pulldown

BLUE: #SHDN with 200k pulldown GREEN: TEC Voltage on channel with 200k pulldown

Both 1M and 200k pulldowns worked fine in 20°C. During startup max Voltage on #SHDN was 650mV with 1M and ~160mV with 200k, so TEC didn't started.

R1M_startup_20C

During normal operation at 20°C both resistors worked fine. STM can drive MAX at ~3.3V level. Turn_on_20C

After heating up device to 80°C, 1M pulldown was too weak to prevent turning TEC driver on during power up. (diodes D24/D25 reverse current increased) Voltage on #SHDN increased to ~2.5V. R1M_startup_80C

200k pulldown still was strong enough at startup. Voltage on #SHDN was ~900mV, so less than max low voltage level (1,25V) from TEC driver specification. R200k_startup_80C

Both 200k and 1M allowed to drive #SHDN from STM32 at ~3.3V level. Turn_on_80C

gkasprow commented 2 years ago

Good catch. One can also use a silicon diode level shifter.

nkrackow commented 2 years ago

Good timing, could be that I ran into this problem yesterday while bringing up the TECs on Thermostat-EEM. But my drivers did not turn on at room temp. I will check.

maciejprzybysz commented 2 years ago

(..) But my drivers did not turn on at room temp. I will check.

@SingularitySurfer It won't turn on with 10k resistor pulldown even in room temperature. Please notice that the scopes above are taken after changing R94 resistor to 200k on first channel and 1M on another.

nkrackow commented 2 years ago

(..) But my drivers did not turn on at room temp. I will check.

@SingularitySurfer It won't turn on with 10k resistor pulldown even in room temperature. Please notice that the scopes above are taken after changing R94 resistor to 200k on first channel and 1M on another.

Yeah, thanks, I've confirmed that and put it into https://github.com/sinara-hw/Thermostat_EEM/issues/56. I'll put a few more observations there.

gkasprow commented 2 years ago

Let's add TTL buffer that translates 3.3V logic level to 5V logic level. 74HCT1G125GW image

gkasprow commented 2 years ago

fixed in 2.2.2

jordens commented 1 year ago

Don't you want such a translator for FREQ as well? The screenshot above doesn't have one.

gkasprow commented 1 year ago

I already implemented it as well.