Re: DS18B20 not reading every time
Posted: Wed Mar 23, 2022 2:14 pm
Hello,
Ok the problem is occurring as the WIFI comunications will be generating interrupts which will be lengthening the delays for the 1-wire communications. I've had a bit of a dig and it looks like there may be a way to use the onboard peripheral to do the 1-wire timings but before we go down that route we can try temporarily disabling the interrupts and see if that helps at all or creates more issues.
So before you start the 1-wire comms try calling this via a C-code icon.
Then immediatley after the 1-wire comms is complete re-enable the interrupts.
fingers crossed.
I would try something like this
Ok the problem is occurring as the WIFI comunications will be generating interrupts which will be lengthening the delays for the 1-wire communications. I've had a bit of a dig and it looks like there may be a way to use the onboard peripheral to do the 1-wire timings but before we go down that route we can try temporarily disabling the interrupts and see if that helps at all or creates more issues.
So before you start the 1-wire comms try calling this via a C-code icon.
Code: Select all
portDISABLE_INTERRUPTS();
Code: Select all
portENABLE_INTERRUPTS();
I would try something like this