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

netduino classic reset problems


  • Please log in to reply
13 replies to this topic

#1 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 10 July 2012 - 11:33 PM

Hello, I am getting reset issues. Not only while in C#, but also when running a program thats downloaded onto the netduino. Pressing reset wiuth a working program loaded into the netduino, should work everytime. This also happens when working with C# on PC, it locks the c# up , or it comes back saying it cannot find the netdurino device. I have an LCD screen attached, sometimes it comes up with bars on it and just sits there. Pressing reset sometimes corrects this or it just locks up again. This problem is not just related to the PC USB interface. Other times it comes up with mixed chrs. ALways showing the top line of the LCD, 16 x 2. I am getting rather frustrated with this, what use is it developing stuff when you cannot rely on a reset restarting the program. If i cannot find a solution to this i will to get another type of microcontroller, its wasting my time and $$.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 10 July 2012 - 11:39 PM

Hi tree frog, Really quick...if you plug in your Netduino using an AC-DC power adapter, does your app run reliably? It's possible that the circuit on your Netduino may be taking more power than your computer is providing... Chris

#3 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 10 July 2012 - 11:40 PM

No it does the same thing off a 5v supply totally separated from the pc....

#4 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 10 July 2012 - 11:42 PM

The supply is rated at 500 ma, i only have an LCD apart from the netdurino. so it should not be a problem, and besides that it does it on the pc also.

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 July 2012 - 01:06 AM

Hi tree frog, Thank you for the follow-up. I don't quite understand what's going on, but I'd like to so we can help resolve the issue. Is there any chance you could take a quick video of what's happening with a cameraphone? Then upload it either as a private youtube video or via a dropbox-style service and share the link? If we can see what's happening (code, video, etc.) then we can dig deeper into what's going on. If you can't do that, can you please explain with some detail the sequence of actions you're taking, what you're seeing, etc.? Thank you, and sorry for any troubles you're having... Chris

#6 Matt Isenhower

Matt Isenhower

    Advanced Member

  • Members
  • PipPipPip
  • 74 posts
  • LocationSan Diego, CA

Posted 11 July 2012 - 01:27 AM

Hi Tree Frog, If I understand correctly, it sounds like you're using a standard HD44780-based LCD module. When these displays are uninitialized, they will often show just a dim bar across the first row and nothing on the second row. If you try to send data when the display module is in that state, usually nothing will happen or you may be able to see some of it faintly on the first row. It sounds like your display isn't being initialized correctly, or it isn't being initialized reliably. This can be caused by a few things, but due to variations in HD44780-compatible controllers, it's usually because of timing issues. When the display is first powered on, it needs about 60ms before it can take commands, and then the initialization command needs to be sent at least 3 times with a 10ms or so delay between each transmission. Additionally, there are requirements for how long the "enable" line is set active for each command, and timing between commands, etc. If you're using an existing HD44780 library to control your LCD, the timing issues should already have been worked out by the author of that library, but it still may need some tweaks. Could you post your code and tell us what (if any) libraries you're using? Thanks, Matt
Komodex Labs
Follow me on Twitter: @mattisenhower

#7 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 11 July 2012 - 01:51 AM

Hello ok here is the code, i have taken out a few remarks etc to make smaller. Its a trivial program and not finished but, this is basically the code i am writing. using System.Threading; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware.Netduino; using MicroLiquidCrystal; namespace System_Timer { public class Program { public static void Main() { var lcdProvider = new GpioLcdTransferProvider( Pins.GPIO_PIN_D12, Pins.GPIO_PIN_D11, Pins.GPIO_PIN_D5, Pins.GPIO_PIN_D4, Pins.GPIO_PIN_D3, Pins.GPIO_PIN_D2 ); // create the LCD interface var lcd = new Lcd(lcdProvider); lcd.Begin(16, 2); // Set display to 16x2 lcd.Clear(); // Clear display // set the cursor to column 0 lcd.SetCursorPosition(0, 0); // set to top left chr of lcd lcd.Write("System Clock"); // set cursor to column 1 lcd.SetCursorPosition(0, 1); // clear strings string Seconds = ""; string Minutes = ""; string Hours = ""; while (true) { lcd.SetCursorPosition(0, 1); Seconds = Utility.GetMachineTime().Seconds.ToString(); Minutes = Utility.GetMachineTime().Minutes.ToString(); Hours = Utility.GetMachineTime().Hours.ToString(); lcd.Write(Hours+":"+Minutes+":"+Seconds); Thread.Sleep(1000); } } } } Basically as you can see it displays the system timer on the LCD. Yeah i know its not finished yet... The program is loaded onto the netduino. Its powered from a separate power supply. When you press reset, several things can happen. 1 :- It starts up ok and runs ok, displaying the system timer counting up. 2 :- It attempts to start up, but leaves the LCD with the top line full of blocks, and does nothing more. 3:- It attempts to start up but leaves the LCD with the top line full of various chrs, always the same ones. When connected to PC and c# it can do the same thing. Often with C# complaining that it cannot find the netduino device. I have checked all the connections and they all look 100%. I cannot make this happen by wiggling any leads. I would love to get this sorted out it is very frustrating...

#8 Matt Isenhower

Matt Isenhower

    Advanced Member

  • Members
  • PipPipPip
  • 74 posts
  • LocationSan Diego, CA

Posted 11 July 2012 - 02:02 AM

One other thing I forgot to mention -- Is this a 3.3V LCD module? If you're using a 5V LCD, the 3.3V output levels of the Netduino may not work reliably. I just looked a the MicroLiquidCrystal library's source code, and in Lcd.cs it looks like there is a hard-coded 5ms delay between initialization messages. Additionally, there is a hard-coded 50ms delay at the beginning. If I remember correctly, the initial delay should be about 62ms and the time between the first two initialization messages should be about 10ms. You could try increasing all of these delays to see if that helps. Having too much of a delay won't be a problem, but having too little delay could lead to the issues you are seeing. Additionally, it looks like there is no delay specified during the Enable line pulse. Check GpioLcdTransferProvider.cs, near the end. You might try adding Thread.Sleep(5) before and after _enablePort.Write(false). Try that out and see what happens, let me know how it goes! :)
Komodex Labs
Follow me on Twitter: @mattisenhower

#9 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 11 July 2012 - 06:16 PM

Hello, So you are saying that to get the netduino to work i have to modify a library.. There must be folks out there that are using LCD's without problems that do not have to modify libries to get it to work correctly. That does not answer the problems i get with windows, not being able to find the device from time to time, as it fails there also. Perhaps i need to send it back for a replacment. What libs are others using for LCD driving...

#10 Matt Isenhower

Matt Isenhower

    Advanced Member

  • Members
  • PipPipPip
  • 74 posts
  • LocationSan Diego, CA

Posted 11 July 2012 - 06:28 PM

Hi Tree Frog,

So you are saying that to get the netduino to work i have to modify a library..

Not necessarily. Different LCD modules tend to use different controllers, and while they're "HD44780 compatible" there may be some slight variations and some of them may require different timings. I am just suggesting some changes that may help or fix the problems you're having with the display -- I don't know for sure whether they'll fix the problems but I think it'd be worth trying just to see what happens. If nothing else, it could help eliminate one potential cause of the issues you're seeing :)

Regarding issues with Windows, could you provide some more details about the problem you're seeing? Does disconnecting and reconnecting the Netduino allow Visual Studio to find and deploy to the device?

Matt
Komodex Labs
Follow me on Twitter: @mattisenhower

#11 tree frog

tree frog

    Member

  • Members
  • PipPip
  • 19 posts

Posted 11 July 2012 - 08:08 PM

Regarding Visual c# I get this while trying to deploy to the device via USB. 'device not initialized resetting'. Plugging and unplugging the usb cable has various results, sometimes it finds the device sometimes not.

#12 xmen

xmen

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts

Posted 19 January 2015 - 07:01 PM

Having same problem, did you find any solution?



#13 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 22 January 2015 - 07:24 AM

xmen--what version of firmware are you running? Does this happen on 4.1 (MFUSB + hardware reset) or 4.2 (WinUSB + software reset)?

Chris

#14 xmen

xmen

    Advanced Member

  • Members
  • PipPipPip
  • 72 posts

Posted 22 January 2015 - 08:42 AM

xmen--what version of firmware are you running? Does this happen on 4.1 (MFUSB + hardware reset) or 4.2 (WinUSB + software reset)?

Chris

Currently I'm running 4.3. Issue happens when using character LCD directly(4 data pins, RS, E) and others. Now I'm using I2C Module and it working fine. I think it happening because LCD require 5V and netduino only giving it 3.3V(for data pins, RS, E) and LCD trying to get more current(not voltage). or some other electrical deep stuff.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.