Main Site Documentation

Onewire only works on DI2 and DI3


#1

I have a problem concerning onewire on various digital pins. I am using a DS18B20 and the provided example.

This works fine for Di2 + Di3

Cpu.Pin p = (Cpu.Pin)FEZ_Pin.Digital.Di2;
OneWire ow = new OneWire§;

But not for any other pins.
When I request a temperature conversion, it never returns!

I have tried to put a LED on for example Di0 and I can control it without problems, but OneWire will not work.

I need to be able to use other pins.

Can anybody help out, please?


#2

You will need a pullUp resistor for Onewire bus. Di2 and Di3 has pullUps becaues they can be used for I2C. A pullup resistor of 1.5-5kOhm is required.


#3

Thanks a lot for your reply.
I get the resistor.


#4

You should use 4.7KOhm, see the sensor datasheet.