Open Kabron287 opened 5 years ago
I reduced DS18B20_Slave_Interrupt_T3 as much as possible: void setup() { Serial.begin(115200); Serial.println("Start"); pinMode(tstpin, OUTPUT); ds.init(rom); ds.setScratchpad(scratchpad); ds.setPower(PARASITE); ds.setResolution(9); attachInterrupt(12, DS18B20p, CHANGE); } void loop() { ds.waitForRequest(true); } void DS18B20p() { previousmicros = micros(); difference = previousmicros - old_previousmicros; if (difference >= 380 && difference <= 800) { //on Leonardo // if (difference >= 325 && difference <= 500) { ds.waitForRequestInterrupt(false); } }
void setup() { Serial.begin(115200); Serial.println("Start"); pinMode(tstpin, OUTPUT); ds.init(rom); ds.setScratchpad(scratchpad); ds.setPower(PARASITE); ds.setResolution(9); attachInterrupt(12, DS18B20p, CHANGE); } void loop() { ds.waitForRequest(true); } void DS18B20p() { previousmicros = micros(); difference = previousmicros - old_previousmicros; if (difference >= 380 && difference <= 800) { //on Leonardo // if (difference >= 325 && difference <= 500) { ds.waitForRequestInterrupt(false); } }
Exactly every second request results in NO PRESENCE:
Start packet transmitting RESET PRESENCE No address selected 33 (READ ROM) Packet transmitted successfully Reading byte(s) 28 48 A0 AE 08 00 00 60 Done Start packet transmitting RESET **NO PRESENCE** Start packet transmitting RESET PRESENCE No address selected 33 (READ ROM) Packet transmitted successfully Reading byte(s) 28 48 A0 AE 08 00 00 60 Done Start packet transmitting RESET **NO PRESENCE**
I also could see in oscillosope the absence of the presence pulse every second request.
This Lib is outdated please use the advantage Version from orgua https://github.com/orgua/OneWireHub
Yes, I already switched to OneWireHub. it works OK.
I reduced DS18B20_Slave_Interrupt_T3 as much as possible:
void setup() { Serial.begin(115200); Serial.println("Start"); pinMode(tstpin, OUTPUT); ds.init(rom); ds.setScratchpad(scratchpad); ds.setPower(PARASITE); ds.setResolution(9); attachInterrupt(12, DS18B20p, CHANGE); } void loop() { ds.waitForRequest(true); } void DS18B20p() { previousmicros = micros(); difference = previousmicros - old_previousmicros; if (difference >= 380 && difference <= 800) { //on Leonardo // if (difference >= 325 && difference <= 500) { ds.waitForRequestInterrupt(false); } }
Exactly every second request results in NO PRESENCE:
Start packet transmitting RESET PRESENCE No address selected 33 (READ ROM) Packet transmitted successfully Reading byte(s) 28 48 A0 AE 08 00 00 60 Done Start packet transmitting RESET **NO PRESENCE** Start packet transmitting RESET PRESENCE No address selected 33 (READ ROM) Packet transmitted successfully Reading byte(s) 28 48 A0 AE 08 00 00 60 Done Start packet transmitting RESET **NO PRESENCE**
I also could see in oscillosope the absence of the presence pulse every second request.