I am trying to get my Cobra II to detect a DS18B20 temp sensor but am not having much luck. What I am seeing seems to be similar to discussed in the topic listed below but my understanding is that their particular issue was resolved with the release of the current SDK package.
http://www.ghielectronics.com/community/forum/topic?id=9446
Can someone confirm if I have the correct firmware/software package in regards to the OneWire fix.
I am using the following:
- Sealed waterproof DS18B20 sensors
- Cobra II (Firmware 4.2.9.0)
- NETMF 4.2 (2013-02-14 GHI package)
- Breakout connector.
Have wired up the sensor to the breakout board, VCC → 5v, GND → GND, Data → pin5 and connecting it to Socket 6 on the mainboard.
For testing I am using the following code:
Debug.Print("Initialising OneWire Port");
Debug.Print("=======================================");
// Configure onewire output port to socket 6, pin 5
GT.Socket socket = GT.Socket.GetSocket(6,true,null,null);
OutputPort port = new OutputPort(socket.CpuPins[5], false);
OneWire ow = new OneWire(port);
ArrayList list;
while (true)
{
Debug.Print("Resetting Onewire Bus");
Debug.Print(" - TouchReset Result: " + ow.TouchReset());
Debug.Print(" - Calling Find All Devices function");
// Only have one device connected so expect result to be 1
list = ow.FindAllDevices();
Debug.Print(" - Device Count: " + list.Count.ToString());
Debug.Print(" - Clearing List");
list.Clear();
Debug.Print("---------------------------------------");
System.Threading.Thread.Sleep(10000);
}
This gives me the following output:
Initialising OneWire Port
Resetting Onewire Bus
- TouchReset Result: 1
- Calling Find All Devices function
- Device Count: 0
- Clearing List
One thing to note is that the TouchResult is always 1 even if I purposely specify a socket/pin which is not connected to the sensor. What should the TouchResult be for a positive identification of a onewire device?
I have tested the sensor on a Panda II (4.1 using the GHI Onewire implementation) and that works fine.
Any thoughts?
Cheers, Keith.