Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Stuart Crawshaw's Content

There have been 60 items by Stuart Crawshaw (Search limited from 29-April 23)


By content type

See this member's


Sort by                Order  

#15134 OneWire ALPHA

Posted by Stuart Crawshaw on 06 July 2011 - 12:00 PM in Beta Firmware and Drivers

The 24LC256 is tested successfully. I think the signal is the same but you won't harm a thing by trying I suppose ;)


Ok sounds good to me. So on your recommendation (at least until 4.2 makes it to release, and if the powers that be roll a version with one-wire) i have downgraded to the 4.1.1 FW attached to this thread.

But now, i cannot deploy anything to it... I just get a message stating:

Error	1	An error has occurred: please check your hardware.



#15123 OneWire ALPHA

Posted by Stuart Crawshaw on 06 July 2011 - 09:17 AM in Beta Firmware and Drivers

Do you have an example IC? I used a 24LC256 EEPROM with success on a 4.1.x Netduino.


I believe This one is in the same family. You mention using it successfully? Did you use commands such as Random Read (Figure 7.2) as this requires a repeated START signal?



#15137 OneWire ALPHA

Posted by Stuart Crawshaw on 06 July 2011 - 12:20 PM in Beta Firmware and Drivers

If you go to your project properties, what's the target framework? See this screenshot for what I mean.
Also, to which device does it try to deploy? See this screenshot for what I mean.



Hi,

Checked that as you advised and the Target is 4.1 (i have uninstalled the 4.2 SDK and installed the 4.1 again)
Then checked Deploy device, and it says USB > Netduino_netduino.

I might try re-flashing again:

To confirm, i am ok to use the 4.1.0.6 TinyBooter for use with the 4.1.1 Beta 1 with CW's OneWire FW? If not where can i download the correct booter image (its hard to find downloads for the different versions on here :P )



#15139 OneWire ALPHA

Posted by Stuart Crawshaw on 06 July 2011 - 01:09 PM in Beta Firmware and Drivers

Should be right.
As far as I know, yes.

Sorted it, was my fault really.

I had reference the dll for the onewire managed code which resides in the "le" folder where as the test app references the on in the root of the Debug directory.



#15176 OneWire ALPHA

Posted by Stuart Crawshaw on 07 July 2011 - 11:04 AM in Beta Firmware and Drivers

Appologies for pretty much hijaking this thread, but i have one more question. Regarding the OneWire library here, If i have 5 sensors connected to the netduino, is there any way i could read a particular sensor, say sensor 4. and then take a reading from sensor 2. the example code shows that the SkipRom command is sent followed by a ConvertT command then read scratchpad, but this does not show how to target a specific ROM. Hope this makes sense.



#15120 OneWire ALPHA

Posted by Stuart Crawshaw on 06 July 2011 - 08:52 AM in Beta Firmware and Drivers

HI Stuart,

An I2C EEPROM also works on 4.1.x firmwares. Code sample can be downloaded at http://forums.netdui...e-i2cbus-class/


Even the ones where repeated START signals are required?



#15191 OneWire ALPHA

Posted by Stuart Crawshaw on 07 July 2011 - 07:23 PM in Beta Firmware and Drivers

Never mind,

I figured it out.


// Instruct a single DS18*20 to do a temperature conversion and read result.
public static void GetSingleTemperature(byte[] romAddess)
{
  var oneWire = new OneWire(Pins.GPIO_PIN_D0); // Adjust the pin if necessary
  if(oneWire.Reset())
  {
    // DS18B20 Thermometer
    oneWire.WriteByte(OneWire.MatchRom); // Address single device
    oneWire.Write(romAddress);           // 64bit ROM code stored in byte[] romAddress
    oneWire.WriteByte(DS18B20.ConvertT);
    Thread.Sleep(750);                   // Wait Tconv (for default 12-bit resolution)

    oneWire.Reset();
    oneWire.WriteByte(OneWire.MatchRom); // Address single device
    oneWire.Write(romAddress);           // 64bit ROM code stored in byte[] romAddress
    oneWire.WriteByte(DS18B20.ReadScratchpad);

    // Read just the temperature (2 bytes)
    var tempLo = oneWire.ReadByte();
    var tempHi = oneWire.ReadByte();
    var temp = DS18B20.GetTemperature(tempLo, tempHi); // ((short)((tempHi << 8) | tempLo))/16F
    Debug.Print(temp.ToString());
  }
}

// Get temperature reading from all devices on the bus.
public statis void EnumerateAllDeviceTemps()
{
  var rom = new byte[8]; // 64-bit
  var deviation = 0;  // Search result
  do
  {
    if((deviation = oneWire.Search(rom, deviation)) == -1)
      break;
    if(OneWire.ComputeCRC(rom, count:7) == rom[7])
    {
      // Found a valid device ID
      GetSingleTemperature(rom);
    }
  }
  while(deviation > 0);
}



#15051 OneWire ALPHA

Posted by Stuart Crawshaw on 05 July 2011 - 01:36 PM in Beta Firmware and Drivers

Hi guys, I havent been able to find the answer to a question i have been asking myself. Does this only apply to the DS1820 sensors when used in Paracitic power mode ONLY? as my understanding is, it was a limitation because of the timings being in milliseconds and anything longer than 970uS would cause a power-on reset to occur? So, the question is, do i need this native driver if i an wiring my DS Sensors in a non-paracitic circuit? Thanks, Stuart.



#15104 OneWire ALPHA

Posted by Stuart Crawshaw on 06 July 2011 - 01:34 AM in Beta Firmware and Drivers

The 1-Wire firmware is built with the 4.1.1 Beta 1 FW already. Were you testing the 4.2.x FW? As I understand it, the reason you have to have the 1-Wire support in the firmware is because 1-Wire communication is too fast for the managed code to handle.

-Valkyrie-MT


Hi,

Yes i am running the 4.2.x FW. I originally wanted to know if the OneWire limitation was for paracitic mode only, but you have answered that question for me.

But yes, it does seem that the managed code is too slow for onewire to be used without native support.

the reason i want to use the 4.2.x FW is its I2C support as i want to include an I2C EEPROM chip i have to save user settings (such as high temp thresholds etc for a thermostat type setup).



#15078 OneWire ALPHA

Posted by Stuart Crawshaw on 05 July 2011 - 04:55 PM in Beta Firmware and Drivers

Hi guys,

I havent been able to find the answer to a question i have been asking myself.

Does this only apply to the DS1820 sensors when used in Paracitic power mode ONLY? as my understanding is, it was a limitation because of the timings being in milliseconds and anything longer than 970uS would cause a power-on reset to occur?

So, the question is, do i need this native driver if i an wiring my DS Sensors in a non-paracitic circuit?

Thanks,
Stuart.


Anyone?



#15097 OneWire ALPHA

Posted by Stuart Crawshaw on 06 July 2011 - 12:38 AM in Beta Firmware and Drivers

Not entirely sure I understand your question, so I'll try to answer with some observations/facts.

  • You must have this native driver to directly communicate with 1-wire devices (parasitic or not) with the Netduino (alternatively, you can use components like those from Peter Anderson)
  • With this firmware, I can read from a mix of DS18B20, DS18S20, DS18B20PAR sensors some connected in parasitic mode (only 2 wires - ground and 1-wire signal) and others connected with the 5VDC (non-parasitic). I currently have 5 sensors connected - 3 are not parasitic and 2 are parasitic. That works fine.
  • On occassion, I will get a bad read (think 1 in 50 reads) for whatever reason (possibly because I don't have a MOSFET as recommended), but with the CRC check, you always know, so I handle them easily. And usually, it won't happen twice on the same sensor.

-Valkyrie-MT



Thats a shame, i was hoping to write my own class to handle the DS1829 sensors so i could continue to use/test the 4.1 FW.



#15036 Netduino Firmware v4.2.0 BETA 1

Posted by Stuart Crawshaw on 05 July 2011 - 10:37 AM in Beta Firmware and Drivers

Hi all, Does this beta include the OneWire support by CW2? On another note, Since updating i can no longer deploy to my Netduino... I just sticks at deploying... I did notice however that when updating with MFDeploy, the output did not seem "complete" (see below) Deployment Status says: 1. Checking Signature 2. Erasing 0x0******* (cant remember exactly) 3. Deploying ER_FLASH 3. Checking Signature 4. Exiting application and the output window of MFDeploy says: "Chk s" and thats it. If i then try to click Target > Device Capabilities, it says "Error: No Response From Device" Ive seen screenshots and this normally says "Checking Signature, "Signature Passed"? Any idea what might be going wrong? Thanks,



#15521 DS1307 Sparkfun I2C

Posted by Stuart Crawshaw on 15 July 2011 - 09:49 AM in Netduino 2 (and Netduino 1)

Can't confirm nor contradict it; I didn't wrote the code, only successfully implemented it. But I used the 4.1.1 beta firmware at that time.


Ahh ok,

I believe it would thought, makes sense that it would to me.

If it is the case, then the read command would be executed without an address being sent to the device.



#15531 DS1307 Sparkfun I2C

Posted by Stuart Crawshaw on 15 July 2011 - 11:43 AM in Netduino 2 (and Netduino 1)

Yes, I connected everithing well again......thank you very much for wasting your time with my problem, shure that the problem it´s a little detail(a dumb detail shure) but if I can i would try to put a photo of whow I´ve got the connections.........


You are not wasting our time i assure you. The success of a good community is mutual help. No problem is dumb, its all down to experience (I am not an expert in electronics at all, im a coder)

No question, big or small is a dumb question. The most intelligent thing people can do when unsure is to ask :)

P.S. Did you see my code example i posted on the previous page (hate pages :P) the attached library/wrapper may well prove useful.



#15527 DS1307 Sparkfun I2C

Posted by Stuart Crawshaw on 15 July 2011 - 11:35 AM in Netduino 2 (and Netduino 1)

I updated the firmware to 4.1.1 beta version but I´m in the same way, it doesn´t work neither with my code not with that one you posted, it gives me the same error that i have told you before..........


OK,

Can you post the code you have used, please bare in mind that the transaction for a read should include an initial write (to write the address of the register to be read) and then a read.

Please see this excract of code from the FusionWare I2C Library (attached).
/// <summary>Performs a common Write-repeatstart-read command response operation</summary>
/// <param name="Config">Configuration for the bus during this operation</param>
/// <param name="WriteBuffer">Buffer containing data to write</param>
/// <param name="ReadBuffer">Buffer to receive data. The Length property of ReadBuffer determines the number of bytes to read</param>
/// <param name="TimeOut">Millisecond time out value</param>
/// <remarks>
/// Many I2C devices have a simple command response protocol of some sort
/// this method simplifies the implementation of device specific drivers
/// by wrapping up the I2CTransaction creation and timeout detection etc.
/// to support a simple command/response type of protocol. It creates a write
/// transaction and a read transaction with a repeat-start condition in between
/// to maintain control of the bus for the entire operation. 
/// </remarks>
/// <exception cref="T:System.IO.IOException">Operation failed to complete</exception>
public void WriteRead(I2CDevice.Configuration Config, byte[] WriteBuffer, byte[] ReadBuffer, int TimeOut)
{
    ThrowIfDisposed();
    lock(this.Device)
    {
        this.Device.Config = Config;
        I2CDevice.I2CTransaction[] xacts = new I2CDevice.I2CTransaction[] {
            I2CDevice.CreateWriteTransaction(WriteBuffer),
            I2CDevice.CreateReadTransaction(ReadBuffer)
        };

        // I2CDevice.Execute returns the total number of bytes
        // transfered in BOTH directions for all transactions
        int byteCount = this.Device.Execute(xacts, TimeOut);
        if(byteCount < (WriteBuffer.Length + ReadBuffer.Length))
            throw new System.IO.IOException();
    }
}

EDIT: Corrected spelling of FusionWare

Attached Files




#15518 DS1307 Sparkfun I2C

Posted by Stuart Crawshaw on 15 July 2011 - 09:42 AM in Netduino 2 (and Netduino 1)

Also i noticed this in your code

I2CDevice.I2CTransaction[] tran = new I2CDevice.I2CTransaction[]{tran_write}; 
 
            int data = RTC.Execute(tran, 100); 
 
            Debug.Print("\nThe number of data transfered is: "+ data.ToString()); 
 
            tran = new I2CDevice.I2CTransaction[] { tran_read }; 
            
            data = RTC.Execute(tran, 100); 


After each Execute, it would produce a stop bit. Thus cancelling the address it was at (I think) and the read may not know where to reference.

Stefan, Can you confirm this? as i dont have my DS1307....yet...



#15516 DS1307 Sparkfun I2C

Posted by Stuart Crawshaw on 15 July 2011 - 09:39 AM in Netduino 2 (and Netduino 1)

Just to add as i dont know if its been touched on in this thread. The DS1207 requires the repeated start support of one of the custom built FW's (Im using 4.1 with CW's OneWire Library) Can you confirm if you are using the stock firmware or a custom build with the repeated start bit support?



#15423 Newbie ds18b20 questions

Posted by Stuart Crawshaw on 13 July 2011 - 02:00 PM in Netduino 2 (and Netduino 1)

You may also want to check out Stuart's DS18*20 Temperature Sensor Auto Identity Circuit.


Thanks for the link to my topic! Just to update on this, i am awaiting components to build the circuit, just need some transistors really. Currently working on the code to do the hard work and then ill post it all on my thread.

In theory, with my idea, you would have as many sensors on the bus as needed (buy you would need a transistor for each of them to turn them on/off) and a shift register per eight sensor/transistor pairs.

so in the case of 8 sensors, you would send 1 byte to the shift registor to set pin 0 high and the rest low -> read the ROM code from the sensor bus, and then turn off pin 0 and turn pin 1 on etc etc... at the end send all 1's to the SR and all sensors will be active.



#15687 Six Button Interface for LCD Menu System.

Posted by Stuart Crawshaw on 19 July 2011 - 03:34 PM in General Discussion

You will get an error because both will try to initialize the SPI bus.


The code I have would (in thory) use a centralised "shared" SPI bus (a static property of the main program, initialized on startup). Could i not modify it to work with the "shared bus"?



#15691 Six Button Interface for LCD Menu System.

Posted by Stuart Crawshaw on 19 July 2011 - 04:47 PM in General Discussion

Back in the 90's the Parralax stamp used 1 pin for 8 switches.
Bad fritzing but will give you an idea.

In this example (cant find single pin of gnd plane :huh: )
The resistors are connected to an analoge in pin and the capacitor end is connected to gnd (or however the netduino handles it)

The whole thing reads as a potentiometer so is simple to work.
Going by what I have lurned so far you may be able to drop the cap.

I hope this helps with your button issue.



Thats an interesting idea, thank you.
Ill keep this in mind, wouldn't this idea how ever require some slight pre-programming of the values per switch and also, if i press multiple switches at once, would this not cause an issue?



#15683 Six Button Interface for LCD Menu System.

Posted by Stuart Crawshaw on 19 July 2011 - 03:10 PM in General Discussion

If you want to combine that LCD driver with other SPI devices (which is the case in my sample above) you need to use another LCDTransferProvider. I got one ready for that. Will upload it later today.


If i understand that correctly, i couldnt use the multiplexing solution as well as have an LCD on the SPI bus?

I read your post and it looks AMAZING! Just want i was looking for, but on a smaller scale :P.



#15679 Six Button Interface for LCD Menu System.

Posted by Stuart Crawshaw on 19 July 2011 - 02:51 PM in General Discussion

Hi all,

Here is the outline,

I want to have a menu system accessible by buttons on my project. The display will be a 20x4 LCD Display and there will be 6 buttons as follows:

  • UP
  • DOWN
  • LEFT
  • RIGHT
  • OK
  • CANCEL

Now the basic idea of how these would work is have an interrupt port setup for each button (but thats 6 ports!). So now the question,

How could i achieve this, but only use the minimal number of ports?

I though about using a PISO Shift Reg, but then remembered it would need a clock etc and someway for the ND to know that data is coming in (i think).

I then there is the Matrix style setup but i would only save 1 pin (2 cols and 3 rows = 5 lines).

Any suggestions, fancy IC's or fancy components that will let be achive this goal?

Thanks for your continued support.
Stuart



#15681 Six Button Interface for LCD Menu System.

Posted by Stuart Crawshaw on 19 July 2011 - 02:58 PM in General Discussion

A few months ago I published a post about multiplexing:
http://forums.netdui...h-the-netduino/

Also HD44780 LCDs can work over 74hc595 IC's.


Thanks, i shall have a read through that post,

I currently have the LCD working via a 74HC595 using the SPI bus, so its just the buttons i need to get working in a conservative fasion.

So, Ill have a read and get back to you.

Thanks again. :D



#15640 Full-featured driver / test code for the Maxim DS1307 real-time clock

Posted by Stuart Crawshaw on 18 July 2011 - 03:49 PM in Project Showcase

Hi, I’m new here. I’m having a hard time trying to display time and date on a LCD.

I have wired up a Netduino, DS1307 RTC module and a 20x4 HD44780-controlled LCD on a breadboard. I can get “Hello World” to appear on the LCD, but not time and date.

Any help is welcome. Thanks in advance.


Hi,

Could you describe the problems you are having? I.E. does it just display garbage, Not at all etc...

And code examples would be a great help also.

Thanks,



#15071 Updating Firmware Failure

Posted by Stuart Crawshaw on 05 July 2011 - 02:56 PM in Netduino 2 (and Netduino 1)

Yes, please try that.

Also...we created a patch in the v4.1 firmware which helped fix this issue. We removed the patch in v4.2, since Microsoft incorporated a permanent fix for the issue there. If you are running into new issues with 4.2, we'd love to know more...so we can update the bug ticket at netmf.codeplex.com.

Thanks for helping test 4.2!

Chris


Running 4.2, i still get the Debugger not in an initialized state, rebooting message.
Hitting the reset button does nothing, pulling the power and re-inserting it seems to move things along.




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.