NETMF 2013 R2 - OneWire - FindAllDevices

Hi, I have updated to the newest SDK Version 2013 R2, but now the Onewire bus doesn’t work like befor. When I run the function FindAllDevices I didn’t get a result any more, with the previous SDK it worked.

Fez Cobra (EMX)

Can any one confirm that there is a bug?

Best regards

Strange, but we will check!

@ jp_miata -

We just tested and it is still good on my side

Hmm, strange, I will rerun my testing

Just tested OneWire on Cerb40-II with the latest firmware and SDK.( 2013 R2) and confirmed that it is working as before. Also tested on G120 and it worked fine.

It work correct on my Cerburino Bee.

Lastest Firmeware and SDK (netmf 4.3 and 2013 R2) installed.

The problem was the cable length. I have 20meters+ , with the old sdk version it works without any problem, but with the new one it fails.

I have to investigate further, it must be an timing problem, I have a little bit of noise on the bus.

My setup is: Pullup 2.2k to 3.3V on the dataline, 5V VCC
I have 12 DS18S20 on the bus, at the moment the topology is a star network.

Any sugestions?

@ jp_miata -

try 4.7K pull up

When I use the 4.7k pull up I can’t get any comunication. With that resistor the devices aren’t able to pull down the bus.

My working setup is now.

5V vcc
2.2k pull up to 3.3V
on each device 100ohm in the data line

My main problem is that I use ready to use ds18s20 sensor with a “stainless steal cap”, they have only one data line so I can’t build a daisy chain, that would be the optimum solution for the bus.

A star network is one of the badest possible configuration for one wire.

I also tested the new firmware and onewire works perfectly.
However, we use a mosfet for the signal leveling.
And we never tested at distance of 20 meters, but we do have many devices connected.

See the attached image to connect the 3.3v g120 pin to the 5V onewire pin.

I have still a problem to find my sensors.

My setup is as attached in the schematic. When I use my oszi I see the reset and presence pulse, then it starts to send the id but it stops and I didn’t understand why. Any ideas?

With the old sdk version it works

I use following code:


           OutputPort port = new OutputPort(Pin.IO27, true);
           
            OneWire bus = new OneWire(port);

            while (true)
            {
                bus.AcquireEx();

                if (bus.TouchReset() == 0)
                {
                    Debug.Print("Unable to reset");
                }

                ArrayList sensors = bus.FindAllDevices();

                if (sensors.Count == 0)
                {
                    Microsoft.SPOT.Debug.Print("No sensors found");
                    Thread.Sleep(1000);
                }
                else
                {
                    Debug.Print("Anzahl: " + sensors.Count);
                    DS1820 sensor;

                    foreach (byte[] id in sensors)
                    {
                        sensor = new DS1820(id, bus, DS1820.Mode.Single);
                        Microsoft.SPOT.Debug.Print("Sensors id: " + DS1820.ConvertToLong(id) + "; Temp: " + sensor.GetValue(true).ToString("F4") + " °C");

                        
                        if (CRC8.Compute(id, 0, 7) != id[7])
                        {
                            Microsoft.SPOT.Debug.Print("CRC Rom false");
                        }

                        if (!sensor.IsCorrect)
                        {
                            Microsoft.SPOT.Debug.Print("CRC scratchpad false");
                        }
                    }
                }
                bus.Release();

My actual test stetup was with a 1.5m long cable, I can’t understand why its not working, the next AC wires are about 1 meter away. The screenshot was taken with only one sensor conected.

Can you go back and install the old SDK and see if it starts to work again? Make sure to completely uninstall the current SDK first.

I think I found the failure. I noticed every time when the display ( 7" version, pre CP7) get configured and I reboot, the sensors where corrupted. So I looked at the configuration, and I changed the propertie: “PixelClockRateKHz” from 25000 to 2500, now the refresh of the display is slower and all sensors works properly.

@ John: is it possible that the EMX Cpu is to slow when the ClockRate is high? btw whats the default value for the 7" touch screen of the FEZ Cobra?

The EMX has a maximum pixel clock of 18,000KHz, so there could definitely be some trouble when exceeding that clock.