This has been an outstanding issue for about 6 or so months. My laptop wonāt properly recognize the device. Iāve posted screen shot after screen shot and thereās no resolution. These issue is there if I use usb or a wall wart.
@ mhectorgato - I do not think we changed anything when it comes to USB. The good news is that we have a lot more time on our hand to do specif testing or to make changes that may work around issues in specific systems/setups.
On the FEZCerbuino bee the char display is still garbled
I tried putting the using Thread.Sleep(0) that i did in the last firmware but no luck
i had to use Thread.Sleep(1) which works.
Good news is that the board must be running faster with the new firmware.
this is the code that works
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
namespace Gadgeteer.Modules.GHIElectronics
{
using System.Threading;
using Gadgeteer.Interfaces;
/// <summary>
/// A simple character display module for Microsoft .NET Gadgeteer
/// </summary>
/// <example>
/// <para>
/// The following example uses a <see cref="Display_HD44780" /> object to display "Hello World" on the character display.
/// First, we clear the screen and set the cursor to the top left corner.
/// Then, we display our desired text to the screen.
/// </para>
/// <code>
/// using System;
/// using System.Collections;
/// using System.Threading;
/// using Microsoft.SPOT;
/// using Microsoft.SPOT.Presentation;
/// using Microsoft.SPOT.Presentation.Controls;
/// using Microsoft.SPOT.Presentation.Media;
/// using Microsoft.SPOT.Touch;
///
/// using Gadgeteer.Networking;
/// using GT = Gadgeteer;
/// using GTM = Gadgeteer.Modules;
/// using Gadgeteer.Modules.GHIElectronics;
///
/// namespace TestApp
/// {
/// public partial class Program
/// {
/// void ProgramStarted()
/// {
/// display_HD44780.Clear();
/// display_HD44780.CursorHome();
///
/// display_HD44780.PrintString("Hello World");
///
/// Debug.Print("Program Started");
/// }
/// }
/// }
/// </code>
/// </example>
public class Display_HD44780 : Module
{
#region Constants
private const byte CLR_DISP = 1; //Clear display
private const byte CUR_HOME = 2; //Move cursor home and clear screen memory
private const byte DISP_ON = 0xC; //Turn visible LCD on
private const byte SET_CURSOR = 0x80; //SET_CURSOR + X : Sets cursor position to X
#endregion
#region Fields
private readonly DigitalOutput BackLight;
private readonly DigitalOutput LCD_D4;
private readonly DigitalOutput LCD_D5;
private readonly DigitalOutput LCD_D6;
private readonly DigitalOutput LCD_D7;
private readonly DigitalOutput LCD_E;
private readonly DigitalOutput LCD_RS;
#endregion
// Note: A constructor summary is auto-generated by the doc builder.
#region Constructors and Destructors
/// <summary></summary>
/// <param name="socketNumber">The socket that this module is plugged in to.</param>
public Display_HD44780(int socketNumber)
{
// This finds the Socket instance from the user-specified socket number.
// This will generate user-friendly error messages if the socket is invalid.
// If there is more than one socket on this module, then instead of "null" for the last parameter,
// put text that identifies the socket to the user (e.g. "S" if there is a socket type S)
Socket socket = Socket.GetSocket(socketNumber, true, this, null);
socket.EnsureTypeIsSupported('Y', this);
this.LCD_RS = new DigitalOutput(socket, Socket.Pin.Four, false, null);
this.LCD_E = new DigitalOutput(socket, Socket.Pin.Three, false, null);
this.LCD_D4 = new DigitalOutput(socket, Socket.Pin.Five, false, null);
this.LCD_D5 = new DigitalOutput(socket, Socket.Pin.Seven, false, null);
this.LCD_D6 = new DigitalOutput(socket, Socket.Pin.Nine, false, null);
this.LCD_D7 = new DigitalOutput(socket, Socket.Pin.Six, false, null);
this.BackLight = new DigitalOutput(socket, Socket.Pin.Eight, true, null);
this.Initialize();
}
#endregion
#region Public Methods and Operators
/// <summary>
/// Clears the screen.
/// </summary>
public void Clear()
{
this.SendCmd(CLR_DISP);
}
/// <summary>
/// Places the cursor at the top left of the screen.
/// </summary>
public void CursorHome()
{
this.SendCmd(CUR_HOME);
}
/// <summary>
/// This function will enable the display, clean it, and enter 4-bit mode.
/// </summary>
public void Initialize()
{
this.LCD_RS.Write(false);
// 4 bit data communication
Thread.Sleep(50);
this.LCD_D7.Write(false);
this.LCD_D6.Write(false);
this.LCD_D5.Write(true);
this.LCD_D4.Write(true);
this.LCD_E.Write(true);
this.LCD_E.Write(false);
Thread.Sleep(50);
this.LCD_D7.Write(false);
this.LCD_D6.Write(false);
this.LCD_D5.Write(true);
this.LCD_D4.Write(true);
this.LCD_E.Write(true);
this.LCD_E.Write(false);
Thread.Sleep(50);
this.LCD_D7.Write(false);
this.LCD_D6.Write(false);
this.LCD_D5.Write(true);
this.LCD_D4.Write(true);
this.LCD_E.Write(true);
this.LCD_E.Write(false);
Thread.Sleep(50);
this.LCD_D7.Write(false);
this.LCD_D6.Write(false);
this.LCD_D5.Write(true);
this.LCD_D4.Write(false);
this.LCD_E.Write(true);
this.LCD_E.Write(false);
this.SendCmd(DISP_ON);
this.SendCmd(CLR_DISP);
}
/// <summary>
/// Prints the passed in string to the screen at the current cursor position. Note: This function will move the cursor position after.
/// </summary>
/// <param name="str">The string to print.</param>
public void PrintString(string str)
{
for (int i = 0; i < str.Length; i++)
{
this.Putc((byte)str[i]);
}
}
/// <summary>
/// Sends an ASCII character to the LCD at the current cursor position. Note: This function will move the cursor position after.
/// </summary>
/// <param name="c">The character to display.</param>
public void Putc(byte c)
{
this.LCD_D7.Write((c & 0x80) != 0);
Thread.Sleep(1);
this.LCD_D6.Write((c & 0x40) != 0);
Thread.Sleep(1);
this.LCD_D5.Write((c & 0x20) != 0);
Thread.Sleep(1);
this.LCD_D4.Write((c & 0x10) != 0);
Thread.Sleep(1);
this.LCD_E.Write(true);
Thread.Sleep(1);
this.LCD_E.Write(false); //Toggle the Enable Pin
Thread.Sleep(1);
this.LCD_D7.Write((c & 0x08) != 0);
Thread.Sleep(1);
this.LCD_D6.Write((c & 0x04) != 0);
Thread.Sleep(1);
this.LCD_D5.Write((c & 0x02) != 0);
Thread.Sleep(1);
this.LCD_D4.Write((c & 0x01) != 0);
Thread.Sleep(1);
this.LCD_E.Write(true);
Thread.Sleep(1);
this.LCD_E.Write(false); //Toggle the Enable Pin
Thread.Sleep(1);
}
///// <summary>
///// Turns the backlight on.
///// </summary>
//public void TurnBacklightOn()
//{
// BackLight.Write(true);
//}
///// <summary>
///// Turns the backlight off.
///// </summary>
//public void ShutBacklightOff()
//{
// BackLight.Write(false);
//}
/// <summary>
/// Sets the module's backlight to the passed in value.
/// </summary>
/// <param name="bOn">True for backlight enabled, false for disabled.</param>
public void SetBacklight(bool bOn)
{
this.BackLight.Write(bOn);
}
/// <summary>
/// Set the cursor to the passed in position.
/// </summary>
/// <param name="row">Row of the desired cursor position.</param>
/// <param name="col">Column of the desired cursor position.</param>
public virtual void SetCursor(byte row, byte col)
{
var row_offsets = new byte[4] { 0x00, 0x40, 0x14, 0x54 };
this.SendCmd((byte)(SET_CURSOR | row_offsets[row] | col));
}
#endregion
#region Methods
/// <summary>
/// Sends an LCD command.
/// </summary>
private void SendCmd(byte c)
{
this.LCD_RS.Write(false); //set LCD to data mode
this.LCD_D7.Write((c & 0x80) != 0);
Thread.Sleep(1);
this.LCD_D6.Write((c & 0x40) != 0);
Thread.Sleep(1);
this.LCD_D5.Write((c & 0x20) != 0);
Thread.Sleep(1);
this.LCD_D4.Write((c & 0x10) != 0);
Thread.Sleep(1);
this.LCD_E.Write(true);
Thread.Sleep(1);
this.LCD_E.Write(false); //Toggle the Enable Pin
Thread.Sleep(1);
this.LCD_D7.Write((c & 0x08) != 0);
Thread.Sleep(1);
this.LCD_D6.Write((c & 0x04) != 0);
Thread.Sleep(1);
this.LCD_D5.Write((c & 0x02) != 0);
Thread.Sleep(1);
this.LCD_D4.Write((c & 0x01) != 0);
Thread.Sleep(1);
this.LCD_E.Write(true);
Thread.Sleep(1);
this.LCD_E.Write(false); //Toggle the Enable Pin
Thread.Sleep(1);
this.LCD_RS.Write(true); //set LCD to data mode
}
#endregion
}
}
I am seeing something puzzling with the latest SDK.
Target Device: Cobra II
SDK: 4.2 Gadgeteer
Attached Modules: None
I created a default Gadgeteer project with the latest SDK. Around 7 out 10 times, when I try to deploy, I get a failure after the iteration count exceeds ~50. But, if I hit the reset button, while the iteration count is occurring, VS is able to attach to the debugger and deployment succeeds. Hitting the reset key works 100% of the time.
I did nothing with the default generated Gadgeteer program except change the Debug.Print() message before each deploy attempt. I did this to insure there was code that actually needed to be deployed to the device.
Has anyone seen anything like this on a Cobra II? Or any other device?
MFDeploy on the FEZ Cerbuino bee seems a little flakey.
i have 4 of them 2 went ok 2 kept giving me a device not responding message.
i eventuallyed just tried to deploy to it and it deployed fine.
Using GHI_NETMF_Configuration_Toolv003 on the cobra 2 wint flaylessly.
Iāve read most of the messages of this post but I think Iāve missed some elements. From now it seems that GHI will only supports VS2012. Do you know if VS2012 can be installed on Vista?