sparkfun / SparkFun_Bio_Sensor_Hub_Library

25 stars 33 forks source link

Voltage level of MFIO as interrupt is only 1.8V, not working with 3.3V input. #27

Closed erikboto closed 1 year ago

erikboto commented 1 year ago

Hi,

I'm trying to use the SparkFun board (SEN-15219) with this library, but I have some issues using the MFIO as interrupt for when new data is available. Looking at the MFIO signal using a logic analyzer and then I see that the voltage of the MFIO line is 1.8 V when it is high and no interrupt has occurred, using an ESP32 at 3.3V this don't work properly. Even if I try enabling the pull-up on the ESP32 input pin the voltage remains at 1.8V, so I guess the MAX32664 wins over my pull-up.

Am I missing something, or should the board have a level switcher between 1.8V and 3.3V in order for MFIO to work as an interrupt properly?

Fun side note: At first it actually seemed to be working ok, except that I got A LOT of interrupts even there was no new data. Then I realized that it was just cross-talk from the SCLK line that affected the MFIO line enough to make it register as a falling edge, and that caused me to do a read which then caused another interrupt so I kept getting interrupt and new values even though it had nothing to do with the proper interrupt signal.

edspark commented 1 year ago

Good afternoon, here's some things I considered. If MFIO is an OUTPUT (INPUT to the ESP32), it would need to be 2.475V (0.75 x 3.3V) for a minimum HIGH voltage. I searched through the Sensor Hub's datasheet and it doesn't seem there's a way to change the polarity (open drain vs. push/pull) of the MFIO pin so that perhaps you could pull it to 3V3 as you suggested.

With that said, there's no way to use it as an MFIO as an INPUT to your ESP32 without translation. You could use one of these:

...or if you have an NCHAN MOSFET and a few resistors you could implement the same circuit in the product above. If we revise this product, level translation on this pin is on the list. Until then, you'll have to poll to get your data. Sorry for the inconvenience.