Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First readout always 0 with MAX6675 with non standard spi pins #2

Open
jpm1712 opened this issue Aug 6, 2022 · 1 comment
Open

Comments

@jpm1712
Copy link

jpm1712 commented Aug 6, 2022

Hi, at first I want to thank you for the driver. I have the problem on my heltec esp32 lora v2.1 board, that i can't use the standard IOMUX spi pins. So i switched over to use gpio spi pins cs-17, clk-2, miso-22. Everything is working fine so far, exept for the first measurement readout being always 0 degrees celsius. This is a problem for my battery driven sensor, because after wakeup it's always the first readout. Digging deeper into the case my results seems to be the following problem: after startup/wake from sleep state esp32 has to switch over from muxed to gpio pin driven spi (initiated by the aqurire spi bus command), which results in an signal level change on the cs signal output. This initiates a new adc sampling on the MAX6675 resulting in a up to 220ms pause (datasheet MAX6675) before you can readout the results. To avoid this, I added a vtask delay command of 220ms right after the spi_device_acquire_bus command in your driver and the problem is gone. I haven't tested the behavior with standard spi pins weather it's the same. However I hope I could help.

@technosf
Copy link
Owner

technosf commented Sep 8, 2023

Could you provide code that reproduces the issue?
Which ESP32 model.
Thanks for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants