2
\$\begingroup\$

I'm trying to pulse-width modulate an output from a 74HC585 shift register.

To achieve this, I plugged a PWM output from a teensy 3.1 microcontroler into the output enable input of the 74HC595. The A output of the 74HC595 is then connected to the ground via a 640 Ohm resistor. Voltage between VCC and ground is 3.3V.

Then I use the microcontroler to shift 0b00000001 to the 74HC595 and I start to PWM the output enable input at 50% duty cycle.

I expect to measure about 1.6V voltage between output A of the 74HC595 and ground. And indeed, if the PWM carrier frequency is slow (100 Hz), that's what I observe.

Problem is, when I try to increase the PWM carrier frequency, the voltage between A and ground increase. For example, I measure 2.7V for a 10 KHz frequency. I measured the voltage between the teensy pwm output and ground, and it is as expected : 1.6 V.

So, I know ICs can't be fed arbitrary high frequencies, but I was under the impression that 10 KHz doesn't qualify as high frequency.

I seem to be unable to understand the problem, so here I am : can anyone explain me the reasons of this behavior ?

\$\endgroup\$
  • \$\begingroup\$ Are you using an oscilloscope to measure the voltage? \$\endgroup\$ – Michael Choi Jan 23 '15 at 4:54
  • 2
    \$\begingroup\$ If you're using a multimeter, all bets are off above a few hundred Hz. Make yourself a smoothing filter with 10k and 1000uF and measure that. Also, check the datasheet of the 595, it's possible that the O_EN takes longer to propagate a turn-on than off; this would increase the duty cycle at high frequencies. \$\endgroup\$ – tomnexus Jan 23 '15 at 5:01
  • \$\begingroup\$ Oh, even simpler: measure the PWM output of the Tiny directly, see if that behaves as expected or also shows this increase. \$\endgroup\$ – tomnexus Jan 23 '15 at 5:06
  • \$\begingroup\$ I am using a multimeter. @tomnexus : I have measured the PWM output of the teensy, and it is 1.6 V. That's why I didn't suspect the multimeter to be the problem. \$\endgroup\$ – Brasillement Jan 23 '15 at 5:11
  • \$\begingroup\$ Look at the graph on p14 of the datasheet. Although the specification for propagation delay of the OE signal is symmetrical, the graph is not equal for enable and disable. They measure disable until 90% voltage, and enable until 50%. You can see a long slow decay when disabling, with no time specification. This would bias it towards producing a higher voltage if switched quickly. If you're measuring the outputs unloaded, try a 1k resistor to ground and see if that changes anything. \$\endgroup\$ – tomnexus Jan 23 '15 at 5:25
0
\$\begingroup\$

You do realize that when \$\overline{\text{OE}}\$ is HIGH your \$\text{Q}_\text{n}\$ outputs are 'high impedance'? Third line in table 3 in below linked datasheet, where \$\text{Q}_\text{n}\$ is marked as Z

This means the output pin has little to no effect on the pin voltage, it is neither driven high, nor driven low. An output capacity is neither charged nor discharged by the 74HC595 and the timing of the signal is entirely dependent on the rest of the circuit.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Well, I do know that they're high impedance, but I must admit that my noobness prevents me to fully appreciate the meaning of it. I simply interpreted it as : "the circuit is kind of open", which seemed good enough for my purpose. \$\endgroup\$ – Brasillement Jan 23 '15 at 6:26
  • \$\begingroup\$ You could probably interpret it as "kind of open", but you'll have to carefully look at what circuitry is attached to the output. It might be possible to fix or at least improve behavior. Add a circuit diagram to your question. Something as simple as a pull down resistor might fix it. \$\endgroup\$ – jippie Jan 23 '15 at 6:39
  • \$\begingroup\$ You were right, the problem was solved with a pull-down resistor. And now, I know what a pull-down resistor is, which might be useful. Thank you. \$\endgroup\$ – Brasillement Jan 23 '15 at 16:01
0
\$\begingroup\$

Multimeters are not designed to measure anything above 1khz for the most part (look at the specs of your multimeter). The averaging logic built into the multimeter is giving you false results.

Take a look at the signal with an oscilloscope and you should see a 10khz square wave with a pk-pk voltage of 3.3v and a duty cycle of 50%. If not, there must be other issues going on with your circuit.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Unfortunately, I don't have that kind of equipment at hand. Note that I didn't use the multimeter for no reason : if I plug a LED between 74HC595 output A and ground, its luminosity increase with the carrier frequency, which led me to investigate the output A voltage. \$\endgroup\$ – Brasillement Jan 23 '15 at 5:23
  • \$\begingroup\$ @Brasillement feed the output back into an ADC on the teensy? \$\endgroup\$ – geometrikal Jan 23 '15 at 5:37
  • \$\begingroup\$ @geometrikal : I will look into it. I didn't know it existed. Thank you. \$\endgroup\$ – Brasillement Jan 23 '15 at 6:21
0
\$\begingroup\$

Some old-school analog multimeters, especially FET models, like a Sanwa EM7000 or Heath IM-5225 have a decent bandwidth of sometimes up to 1MHz. Analog instruments have the advantage that they always measure the average value.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.