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.
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.
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.
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.
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?