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.

gismo's Content

There have been 26 items by gismo (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#64109 Double.ToString() Not working correctly

Posted by gismo on 12 September 2015 - 07:07 PM in General Discussion

@JoopC I wish it were true....for my device. Are you testing on a netduino 2??




#64107 Double.ToString() Not working correctly

Posted by gismo on 12 September 2015 - 05:23 PM in General Discussion

Try using this instead:  myDouble.ToString("F")

 

e.g.

  • LCD.Write(myDouble.ToString("F"));
  • Debug.Print(myDouble.ToString("F"));

 

See this MSDN Article:

Standard Numeric Format Strings

https://msdn.microso...(v=vs.110).aspx

 

No luck. Same result...I switched back to my GHI Cerb device and parameters F2, N2, G2 etc all work. 




#64105 Double.ToString() Not working correctly

Posted by gismo on 12 September 2015 - 01:01 PM in General Discussion

I'm trying to show two decimal places and using the limited format specifiers it's not working. I'm trying this loop and I get the same result: 22.5034567...

 

 

            double myDouble = 22.503456785478;
            string[] formats = new string[]{"","f2","g2","n2", "d2", "0.00","N2"};
            
            for (int i  = 0;i<formats.Length;i++)
            {
                LCD.Clear();
                LCD.Write(formats[i] + ": " + myDouble.ToString()); //22.50 expected result
                Thread.Sleep(1000);
            }
Aside from writing a custom function to do this, is this a bug? Anyone else experience this? N2 netmf4.3



#64104 Netduino 2 4.3 Won't Attach To Debugger and Board Keeps Resetting

Posted by gismo on 12 September 2015 - 12:36 PM in General Discussion

What version of Visual Studio? I had this same issue a couple weeks ago, had me pulling my hair out. I upgraded to VS2013 and it does not seem to happen anymore. Nobody offered a better solution, unfortunately. At least in my case I could watch the output in MFDeploy if I hit ping right after ND begins to boot. I am convinced this has something to do with the plugin for VS.

 

Good Luck

 

I'm using VS2012. The issue mysteriously disappeared for a while, but now it's back...Sounds like a hack with MFdeploy...Other than upgrading..I wonder what else I can do.




#64061 Dinosaur Prop

Posted by gismo on 09 September 2015 - 12:42 PM in General Discussion

try www.instructables.com




#63964 I2C Bus Problem - Debugging

Posted by gismo on 24 August 2015 - 03:35 PM in General Discussion

Shouldn't you be connecting to the SDA (or SD) and SCL (or SC) lines (top left of the Netduino in your diagram)?

 

Regards,

Mark

 ^^ what he said. Your diagram shows an arduino SDA/SCL hookup.




#63963 I2C Bus Problem - Debugging

Posted by gismo on 24 August 2015 - 03:33 PM in General Discussion

Definitely something flakey with the I2C on Netduino. It seems to stop (SCL/SDA locked high) at the drop of a hat.

I can reproduce this simply by connecting my Fluke DVM or Scope probe (1M, 100pF) onto the SCL line (it survives SDA probing). Hooking SDA/SCL into a P82B715 also kills it.

I love my netduino but I need reliable I2C. May need to change hardware if there is no fix for this soon (Hope its not a Netduino board hardware layout issue!).

 

@Tony,

I've also experienced this where SCL/SDA are locked high.BTW, which Netduino board are you using?

 

 

Currenlty I don't have the possibility to send a photo but, I'm using a breadboard to test all and the 'cables' are about 10 cm (cables used to connect the SDA/SCL to the PCF8574, all others connections are made with breadboard jumper).

 

I have used two 4.7 Kohm resistors (pull-ups to +5V) connected the SDA/SCL of the PCF8574N. All the connections are made on a breadboard and I'm using the +5V directly from the Netduino.

 

Edit: I have added a sketch of my test condition:

sketch01.jpg

@Gigios, do you have a scope?(you can use an arduino as a basic scope and/or logic analyzer). Also, at the very least, when your device doesn't work, can you put a multi-meter on the SDA/SCL lines and see if they are high or low?




#63779 netduino driver for the AdaFruit SSD1306 OLED display

Posted by gismo on 05 August 2015 - 09:03 PM in Project Showcase

I'm currently working on support for the very similar SH1106 OLED driver. I was able to get I2C version working with very few modifications, but I cannot get the SPI version to work correctly(which I prefer at this point). Anyone want to collaborate on getting SH1106 working?




#63736 Netduino 2 4.3 Won't Attach To Debugger and Board Keeps Resetting

Posted by gismo on 31 July 2015 - 10:18 PM in General Discussion

Looking for a device on transport 'USB'
Starting device deployment...
Iteration 0
Opening port \\?\USB#VID_22B1&PID_1000#000000000000#{09343630-a794-10ef-334f-82ea332c49f3}\Operations
Attaching debugger engine...
... debugger engine attached!
Querying device assemblies...
Found Assembly mscorlib 4.3.1.0
Found Assembly Microsoft.SPOT.Native 4.3.1.0
Found Assembly Microsoft.SPOT.Hardware 4.3.1.0
Found Assembly Microsoft.SPOT.Hardware.SerialPort 4.3.1.0
Found Assembly Microsoft.SPOT.IO 4.3.1.0
Found Assembly System.IO 4.3.1.0
Found Assembly Microsoft.SPOT.Hardware.PWM 4.3.1.0
Found Assembly Microsoft.SPOT.Hardware.Usb 4.3.1.0
Found Assembly SecretLabs.NETMF.Diagnostics 4.3.1.0
Found Assembly GoBus 1.5.0.0
Found Assembly SecretLabs.NETMF.Hardware.Netduino 4.3.1.0
Found Assembly SecretLabs.NETMF.IO 4.3.1.0
Found Assembly Microsoft.SPOT.Hardware.OneWire 4.3.1.0
Found Assembly System 4.3.1.0
Found Assembly SecretLabs.NETMF.Hardware 4.3.1.0
Found Assembly NetduinoApplication7 1.0.0.0
Found Assembly Microsoft.SPOT.Net 4.3.1.0
Adding pe file C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\System.pe to deployment bundle
Adding pe file C:\Program Files (x86)\Secret Labs\Netduino SDK\Assemblies\v4.3\le\secretlabs.netmf.hardware.pe to deployment bundle
Adding pe file C:\Users\Chad\Documents\Netduino\Projects\NetduinoApplication7\NetduinoApplication7\bin\Debug\le\NetduinoApplication7.pe to deployment bundle
Adding pe file C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Net.pe to deployment bundle
Attempting deployment...
Incrementally deploying assemblies to device
All assemblies on the device are up to date.  No assembly deployment was necessary.
Assemblies successfully deployed to device.
Restarting interpreter...
Attaching to device...
Waiting for device to initialize...

 

 

This is as far as I get when trying to debug. Then I hear the USB device sound toggle 3-4 times and then it looks like visual studio gives up. 

 

Things I've tried:

  • erasing the board with Netduino Update
  • re-updating firmware with Netduino Update
  • restarting Visual Studio
  • Rebooting Computer
  • trying different USB port on my computer

Any other ideas?

 




#63547 Hey Chris, I sent you a PM about a week ago...

Posted by gismo on 15 July 2015 - 08:16 PM in General Discussion

Thanks Chris. should I send one of my ATTiny devices do you for testing?




#63533 Hey Chris, I sent you a PM about a week ago...

Posted by gismo on 15 July 2015 - 12:54 PM in General Discussion

Hey Chris, 

 

I sent you a PM about a week ago and I just wanted to make sure you've received it.

 

Please delete this post 

 

Thanks!




#63444 Introducing Llilum, the native-compiled (NETMF) proof of concept

Posted by gismo on 09 July 2015 - 04:16 PM in General Discussion

I'll keep my fingers crossed, but I won't hold my breath...




#63439 Introducing Llilum, the native-compiled (NETMF) proof of concept

Posted by gismo on 09 July 2015 - 03:03 PM in General Discussion

So, does this mean we would have access to input capture and direct access to counters/timers on the chip?




#63431 Does Netduino 4.3 Support Clock Stretching by I2C Slave Devices?

Posted by gismo on 09 July 2015 - 02:25 AM in General Discussion

?

 

(I found this old thread http://forums.netdui...y-slave-device/but not real confirmation.)




#63358 I2C Bus Problem - Debugging

Posted by gismo on 03 July 2015 - 12:57 AM in General Discussion

I'm resurrecting this....

 

Fast forward... I'm running netmf4.3 and I've Isolated the issue with the ATTiny85 running as I2C slave mode. This communicates just fine with an arduino, but works about 5% of the time with the Netduino. I can't necessarily repeat the steps to get it to work. When it doesn't work, sometimes the SDA and/or SCL are stuck pulled LOW. I don't know how this happens. I've tried disconnecting the bus but the only thing that resolves this is to reboot the Netduino. This also happens when there are other devices on the bus causing all I2C to fail. I do know that the ATTiny Code uses clock stretching as well. I really have to dig deeper into the I2C Slave Code, but quite hairy at this point.




#63353 ATTiny85 talking to Netduino?

Posted by gismo on 02 July 2015 - 09:20 PM in General Discussion

I hope this thread isn't dead.. I've been off/on struggling to get some ATTiny85 chips to comminicate via I2C with a netduino.... They seem to work fine when doing ATTiny arduino to Arduino, but there must be some subtle differences in the I2C protocol buried in the ATTtiny I2C firmware that NetMF/Netduino don't like..I still haven't found it.

 

Larsey/Frode, you still working with the ATTinys?




#63311 Writing a better class to Manage EEPROM Chip - Guidance/Advice Wanted

Posted by gismo on 30 June 2015 - 04:21 PM in General Discussion

Hey Everyone,

 

I've been racking my brain over writing a better class to manage an I2c EEProm chip. The chip works and all of the basic commands are working, but to really implement it in a way that's legible and useful has been tricky. I'm looking for an advice on how to compose a class that will make using the EEProm chip easier to work with.

 

 

A few inputs/requirements,

  • there are several data-points that needs to be stored on the chip..for example 20+ values.
  • Some are single bytes some are multiple bytes.
  • For each data-point in the class, there needs to be an EEProm Address, DisplayName,NumberOfBytes, RamValue, a type/category/flag..or possibly any other information about the data-point
  • We need to load most/all/or a filtered set of values into RAM when the device starts up..these are "device settings" this should be done with some type of loop as to not make 20 calls to get the value
  • Access to the RAM values should be as simple as 
    EEPROM.MyData1.Value
  • Similarly, updating or overwriting the value on the chip would be 
    EEPROM.MyData2.Update(newValue)
  • Since working with a display on the deivce, each data value would have a "DisplayName".. being able to loop through displayNames for purposes of showing them on a display would be useful. Some type of collection or array?
    EEPROM.MyData3.DisplayName
    
  • Based on looping through the data-points, we need to keep track of what the "current" value is in case we want to read or update.
  • Bonus features: If certain data-points can only contain certain values, can we impose those as choices?.. like "Yes/No" or "On/Off" 

I'm trying to create something simple and scalable..Adding additional data-points should be simple.

 

I've looked at type-safe enum patterns and a few other enum related code to try to accomplish this, but I'm looking for a little more guidance here. Maybe an enum with arrays linked to them?

 

Any advice would be appreciated!

 

 




#63296 Electronics/Breadboarding 101

Posted by gismo on 29 June 2015 - 02:16 PM in General Discussion

Hey and welcome!

 

What I find that helps me is you can replace "arduino" with "netduino" in your web searches...or by adding "arduino" to your searches. There tends to be a heap of useful information in the Arduino community that is totally applicable to a Netduino. Instructables also has great tutorials for Arduino as well that could be translated to Netduino.

 

I think there're plenty of resources out there on microcontroller circuits and you could dive right in to some projects! Have fun!




#63203 Netduino is running slower in certain classes than others(Video)..Why?

Posted by gismo on 18 June 2015 - 01:16 PM in General Discussion

You could also try something like

while (flag)
{
    Thread.Sleep(100);
}

While your Flag is set this loops but with enough time for other Threads to work.

 

This works and is dead simple! ...I have to wonder if there's a better way to do it with Threading...And also which approach is better? (Also, would be nice to get my toes wet with some threading...




#63201 Netduino is running slower in certain classes than others(Video)..Why?

Posted by gismo on 18 June 2015 - 03:38 AM in General Discussion

Thanks Chris... I had and extremely "tight loop"... In my Menu State my "Main Task" Method. I originally had a while(true){} but then there was no way to break out..so I just removed it all..creating that tight loop. The Main program constantly calls the Main Task of the current state. 

 

To fix it, I just put:

Thread.Sleep(Timeout.Infinite);

into the main task and that fixed it!

 

EDIT: Not totally fixed yet..I can't seem to get out of the Menu..I think I need to wake the thread up when I get the interrupt...




#63197 Netduino is running slower in certain classes than others(Video)..Why?

Posted by gismo on 18 June 2015 - 02:11 AM in General Discussion

I've attached a video of the behavior.
 
I've created some state-pattern code to run my device. So far I'm pretty happy with it until I created a "Menu" state. I've created some high level functions to shift/animate text around in my menu state. When within the menu state the device seems to run MUCH slower than when it's in another state. This is shown by how slow the text slides when in the Menu mode. When out of the menu mode, you can see how fast the text is supposed to move. WHY? 

 

Video Clip:

https://youtu.be/RqGceeNpyJI

(Yes, I know I have a few typos in the menu item counter  :) )

 

 

Some thoughts, the scrolling text in the "Menu" is within the interrupt handler while the other code where there is scrolling text is not within the interrupt handler. Could that have any effect? I also might have some locking going on, but I'm not sure how to really diagnose it.




#63038 Troubleshooting LCD With PCF8575 I2C Backpack

Posted by gismo on 03 June 2015 - 09:30 PM in General Discussion

Issue resolved.




#63035 Troubleshooting LCD With PCF8575 I2C Backpack

Posted by gismo on 03 June 2015 - 08:45 PM in General Discussion

Using this device: 
1. http://www.amazon.co...eywords=lcd i2c

 

 

I've converted/ported the driver from here to c#:

2. https://bitbucket.or...ystal/downloads

 

 

I've also referenced some code from here:

3. http://forums.netdui...-and-ir-remote/

I tested the device on an Arduino with the sample code from the drivers in the 2nd link. It works. This device has a different pin mapping than link 3 which is allowed with the arduino driver. I ported this over to c#.

It kind of works...but something is not totally right. I am still able to turn off the backlight and I WAS able to set and move the cursor, but I am not sure what happened and now It's not taking any commands..Yet, I can still control the backlight. When the cursor was working, I was able to send text to the display, but it only worked one time until I restarted the netduino. Now, Only backlight can be controlled.

Code Attached. I've got 4.9k pull-ups on the System..I've also tried pulling up to both 3.3 and 5v with no change.

 

(The code is a work in progress, and will be commented properly when completed)

 

Also attached is the modified I2C bus class that I use(and have used with other devices)
Attached File  I2CBus.cs   2.66KB   4 downloads

 

Update: I fixed a few kinks in the code and it's working! Code Attached

Attached File  LCD.cs   14.81KB   6 downloads

 

I'll be updating the code to implement more of the methods from the arduino driver and will post in the projects forum.

 



 




#63022 Hardware Selection: LCD Screen/Display With "easy" Interface SPI or I2C

Posted by gismo on 02 June 2015 - 08:01 PM in General Discussion

Those looks like nice LCDs. I'll look around in the US for those.

 

 

In the meantime, I'm going to try this out:
 

http://www.amazon.co...eywords=lcd i2c

Anyone know any good working drivers for this display based on the PCF8574t?




#63021 4X20 LCD display with I2C Interface

Posted by gismo on 02 June 2015 - 07:47 PM in Project Showcase

I attached the driver code to the first post.

 

Can you post some sample code that uses your driver?

 

I can't seem to get it to work or initialize the device.





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.