You need to log in to create posts and topics.

DS18B20 sensor throwing ROM command Not implemented warning (version 1.1.0 RC1 R2162 Win x64)

Page 1 of 2Next

Hello,

I have an issue with DS18B20 sensor simulation. I am using Atmega 328 with 3 sensors connected, the firmware is using a library to handle one-wire protocol, and that library to my knowledge correctly implements the protocol based off the Maxim documentation for the sensor. I have checked all the possible timing issues, and could not find any solution to this situation. And the situation is that when I start the simulation, I am getting showered in simulIDE console with these messages:

DS18B20-5 Ds18b20::command : Warning: ROM command Not implemented

DS18B20-4 Ds18b20::command : Warning: ROM command Not implemented

DS18B20-2 Ds18b20::command : Warning: ROM command Not implemented

DS18B20-2 Ds18b20::command : Warning: ROM command Not implemented

And the sensors do not return much of reading - after a couple seconds it seems to give one 0 degrees, regardless of the temperature set on the sensor.

I am at a loss what could be the source of issue, or how to fix it, hence I am asking for help here.

Hi.

DS18B20 is receiving a ROM command that is not recognized.
But it's difficult to know what is happening without the circuit, firmware and library.

Hello, the library being used is from here: https://gist.github.com/stecman/9ec74de5e8a5c3c6341c791d9c233adc

The reset signal seems to be received and responded to correctly (otherwise I'd be getting different reading straight away).

Otherwise I am using these commands:

static const uint8_t kConvertCommand = 0x44;
static const uint8_t kReadScatchPad = 0xBE;

After Reset command two commands are sent: SkipROM (0xCC) then Convert Command (0x44 as per above definition). After that command is sent, conroller waits for 750ms (I was told this is the time sensor should take to convert the temperature) After that, method is executed to get the reading. This library method runs reset signal again to ensure sensor is still there, followed by skip rom, and Read ScratchPad command (0xBE)

I have tried with another library I found online. The difference of that other library, was that reading did not involve second round of reset+skip ROM, and it waited for convertion more actively - in a while loop waiting for sensor to signal finish of conversion process. that second library was getting hung on that while loop (sensor never sent the signal library was waiting for)

I have tried to comment out the second round of reset + skipROM commands from the new library - I am receiving less warnings, but they are still there, and I am still not getting any readings from sensors.

I wanted to attach the circuit file, but I am getting error that I am not allowed to upload fileswith this extension.

 

EDIT: after some additional test with commenting out specific lines in the library itself, it appears that the warning is thrown in response to skip ROM and Convert commands. commenting out just these two results in no warnings thrown (and understandably nothing happens, because there is no converted temperature in the scratchpad.

What I find particularly puzzling, is that definition of these two commands was identical in the other library, and I was getting no error in regards to either skipping rom, not command to start converting.

I wanted to attach the circuit file, but I am getting error that I am not allowed to upload fileswith this extension.

Zip everything and attach here.

SkipROM (0xCC) is implemented, if it is not recognized could be some timing issue.

Here is zipped everything, hex file, circuit in simulIDE and all project files of Atmel Studio 7 project.

EDIT: I have also tried the other library again, but changing the wait from infinite loop to same static wait time, and this version does not have the warnings about unimplemented ROM commands, but still fail to read any temperature from the sensors.

Uploaded files:

Attaching here a project files after some very quick scratch of trying to get the other library plugged back in. Hex file is in debug subfolder. This version of the code, does not throw the warnings, but still fails to read any temperature from the sensor.

Uploaded files:

Thanks, I will have a look.

What I see in the Logic Analyzer is this:

1- Reset
2- Bits recived: 0110011 = 0b1100110 = 0x66 != 0xCC ; (0x66 = 0xCC << 1)

Then the line keeps High...

Is that with the first version of the code, or the second version of the code? If it's the case of second version of the code, then question would be if it is for sure the line used by the sensor plugged into PC0 (because that it the only one actively used in the quick hack to get the old library plugged in and fixed for the loop error).

Looking at the code I do not see much of room for why command should be shifted by a single bit or why should the line get stuck high after sending the skiprom...

Where can I find this logic analizer? 

Is that with the first version of the code, or the second version of the code?

Sorry the first (didn't see the second).

The first problem I found is that there is no pullup resistor and seems that the atmega328 internal pullup is not activated.

Page 1 of 2Next