2
\$\begingroup\$

I have a DS3231 connected to my ESP32, and I'm counting SQW interrupts at 1024 Hz. Apart from the internal pull-up input pin configuration, I added an external 10 kΩ pull-up resistor (could be changed in the future to lower values) to reduce the noise. Still, once in a while I'm getting an extra tick from the SQW pin: say I got 1025 ticks in a second instead of 1024.

To investigate the issue, I connected Adalm1000 board which has two AD7682 ADCs to the output of the SQW pin - this board serves me as an oscilloscope and offers a 200 kSps sampling rate. But when I acquire the signal on this "scope", the main board - ESP32 - does not get interrupts from the SQW pin any longer. I guess that ADC I'm using for sampling is sinking too much current, which should mean that its impedance is lower than the impedance of the ESP32 pins - correct me if I'm wrong.

I don't have a proper scope to test it - it's beyond my budget. Today I learned about op-amp buffers and I think this is the way to go to be able to acquire the signal on the Adalm1000 scope while counting SQW interrupts on ESP32. Or are there easier ways?

If not, which op-amp would be recommend to buy to serve as a buffer? I learned that every op-amp can be wired as a buffer. Since the scope sampling rate is limited to 200 kSps, I think 1 MHz bandwidth would suffice. Will, for example, an LM358 be a good fit?

enter image description here

Update 1

This answer to What does a High Impedance input mean for an ADC lets me think that I'm on the right track to add an op-amp here.

Update 2. Answer

The OPA2834 is suggested to be used as an opamp buffer, and I'll give it a shot for another oscilloscope made from a bare STM32 F429 Disco board with no frontend (link), which offers 7.2 MSps but has no analog frontend as in M1K.

But I marked Pefhany's suggestion as the answer since it offers a correct way to utilize the Adalm1000 built-in frontend.

\$\endgroup\$
4
  • \$\begingroup\$ See page 24 of datasheet. ADC Input impedance of AD7682 is about 2.2k. So, op-amp at input could be necessary (figures 28 and 29). \$\endgroup\$
    – Antonio51
    Nov 20, 2022 at 20:32
  • 1
    \$\begingroup\$ Are you more interested in solving the original problem, or the new problem you have when trying to debug the original problem? \$\endgroup\$
    – Justme
    Nov 20, 2022 at 20:36
  • 1
    \$\begingroup\$ @Justme I'm interested in both. Once I solve the new problem encountered with the M1K scope, I'll return to the original problem. If needed, I'll ask a separate question linked to this discussion. \$\endgroup\$
    – dizcza
    Nov 20, 2022 at 20:42
  • 1
    \$\begingroup\$ For opamp, I should prefer something as OPA2834 ... As the acquisition time is ~ 2us ... be fast. \$\endgroup\$
    – Antonio51
    Nov 20, 2022 at 20:52

1 Answer 1

3
\$\begingroup\$

It's a digital signal so an op-amp is not required (a digital inverter, gate or buffer would work). An LM358 is a rather slow op-amp and would take 10 μs to slew from ~0 V to the 4 V or so output it's capable of. Though with such a slow 5 μs sample rate you would hardly notice.

In any case according to the manual, properly configured ADALM1000 analog inputs are high impedance (with an internal op-amp buffer) to start with:

enter image description here

You want S1..S3 open and S4 closed. An LM358 would also have trouble driving a 50 Ω load (essentially a short circuit) though it would not overly load the open drain SQW output with a 10 kΩ pullup.

\$\endgroup\$
9
  • \$\begingroup\$ It's a digital signal but I wanted to see if the edges are straight. Also, solving the issue only for digital inputs would still require coming up with a solution for analog signal acquisition. \$\endgroup\$
    – dizcza
    Nov 20, 2022 at 20:59
  • \$\begingroup\$ For the M1K part, I cannot find these switches. I remember having a look at this diagram but they don't describe how the user could close or open them. Perhaps, I need to ask a question on their forum on this matter. Updated: I understood the diagram. Thanks. \$\endgroup\$
    – dizcza
    Nov 20, 2022 at 21:01
  • \$\begingroup\$ @dizcza FYI, the SQW output is open drain, and you have a 10k pull-up. The rising edge will not be straight, no doubt about that. \$\endgroup\$
    – Justme
    Nov 20, 2022 at 21:04
  • \$\begingroup\$ @Justme Maybe it will look straight when it's only sampled every 5us. Even with 100pF (more likely to be <10pF) load the time constant would be 1usec. \$\endgroup\$ Nov 20, 2022 at 21:18
  • 1
    \$\begingroup\$ @dizcza Of course you don't see with 100 kHz sampling rate. The period between samples is 10us. With 10k resistor and even 200pF of capacitance, you would not see it. \$\endgroup\$
    – Justme
    Nov 20, 2022 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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