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.
Ok I rewired it completely, so it is exactly as it is in the blog post.
So from the LCD -
1 - GND
2 - 5v
3- 10k pot centre pin
4 - 1 on the SR (shift register)
5- 2 on the SR
6- 3 SR
7- n/a
8- n/a
9- n/a
10- n/a
11- 4 on the SR
12 - 5 on the SR
13 - 6 on the SR
14 - 7 on the SR
public static void Main()
{
// create the transfer provider
var lcdProvider = new Shifter74Hc595LcdTransferProvider(SPI_Devices.SPI1,
SecretLabs.NETMF.Hardware.Netduino.Pins.GPIO_PIN_D10, Shifter74Hc595LcdTransferProvider.BitOrder.MSBFirst);
// create the LCD interface
var lcd = new Lcd(lcdProvider);
// set up the LCD's number of columns and rows:
lcd.Begin(16, 2);
// Print a message to the LCD.
lcd.Write("hello, world!");
while (true)
{
// set the cursor to column 0, line 1
lcd.SetCursorPosition(0, 1);
// print the number of seconds since reset:
lcd.Write((Utility.GetMachineTime().Ticks / 10000).ToString());
Thread.Sleep(100);
}
}
Edit: The strange things appearing seems to be intermittent, it happened when I first turned it on this morning. Here is a picture...
Spike,
Looking at the photo I can't see exactly how you connected wires to the LCD. Did you solder them directly or added header pins?
In any case make sure they are connected firmly. If any of the wires gets disconnected the LCD can't interpret the commands and thus you might get the garbage flickering on screen as you are seeing now.
Szymon, thank you for this library. Just wired up my 7€ LCD as GPIO and it worked right from the spot.
Now i am waiting for my Shiftregisters from Thailand because here in Germany they are much too expensive.
Just one question from a Visual Studio Noob (worked with Java and Eclipse till now), where do i have to put your files so i can use the MicroLiquidCrystal Library via the "using" Argument on the Top of my app?
Just one question from a Visual Studio Noob (worked with Java and Eclipse till now), where do i have to put your files so i can use the MicroLiquidCrystal Library via the "using" Argument on the Top of my app?
Assuming you have a compiled library in an 'assembly' (i.e. the .dll), the next thing you should do is choose "Add Reference..." and select the .dll. (You may have to use the 'Browse' tab and navigate to it on your hardrive.)
From there, you will have access to the namespace defined in the .dll and you can use the functionality in the library.
I have updated the LCD library to support I2C port expanders. In particular this enables to use the library with the Adafruit's i2c/spi LCD backpack: http://www.adafruit....products_id=292http://www.ladyada.n...spilcdbackpack/
Of course it already supported the SPI mode but now you can choose I2C as well (however I found that I2C is 2-3 times slower than SPI). Please see new example project HelloWorld_I2C for demonstration on how to use the new provider.
This release also incorporates the ShifterSetup as sugested by sweetlilmre in this thread. This enables anyone to configure mapping of the shifter outputs to LCD pins. You can pass your setup via optional parameter to shifter constructors.
Of course it already supported the SPI mode but now you can choose I2C as well (however I found that I2C is 2-3 times slower than SPI). Please see new example project HelloWorld_I2C for demonstration on how to use the new provider.
I ordered one of the Adafruit I2C/SPI backpacks anticipating that my current ones that use a SerialPort would not work very well with the Netduino Mini (since I already want to use COM1 for XBee comms)... I anticipated heavy use of I2C in my circuit designs, so this fit right in with that plan.
Your code looks like it has the I2CBus speed set at 100KHz - have you tried upping it to 400KHz? I imagine it would still be slower than SPI, however it might help. I also wonder how well those would perform vs. my 19200 baud serial backpacks... I guess I'll have to wait until the Adafruit order is delivered and do some testing.
I've been trying to get this example to work, but have so far drawn a blank.
I have followed the blog post here and have the LCD wired up following the wiring in the article, I haven't put the backlight on the transistor, instead simply connecting it to the 5v on the netduino. - I can adjust the contrast on the LCD, so I can see blocks or nothing at all.
The LCD I have is a 5v one, will this work with the netduino / shift register example? or do I need to do some logic level conversion as well? (I am using the 5v supply pin on the netduino for the +ve).
Should be no problem at all, I have two 5V LCD's, 20x4 and 16x2, and both work fine
Hi
Thanks for coming back to me so quickly!
I've just moved my circuit from a breadboard to vero board, just in case it was a wiring issue..
I've attached to this post the wiring I have used, taken from your blog post, and the code I'm using is this:
// Micro Liquid Crystal Library
// http://microliquidcrystal.codeplex.com
// Appache License Version 2.0
using System.Threading;
using MicroLiquidCrystal;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
namespace HelloWorld
{
public class Program
{
public static void Main()
{
// create the transfer provider
/*
// Option 1: Use direct GPIO provider
// Initialize the library with the numbers of the interface pins
// Use wiring shown here http://arduino.cc/en/uploads/Tutorial/lcd_schem.png
var lcdProvider = new GPIO_LCD_TransferProvider(Pins.GPIO_PIN_D12, Pins.GPIO_PIN_D11, //Pins.GPIO_PIN_D10,
//Pins.GPIO_PIN_D9, Pins.GPIO_PIN_D8, Pins.GPIO_PIN_D7, Pins.GPIO_PIN_D6,
Pins.GPIO_PIN_D5, Pins.GPIO_PIN_D4, Pins.GPIO_PIN_D3, Pins.GPIO_PIN_D2);
*/
// Option 2: Use shift register provider
var lcdProvider = new Shifter74Hc595LcdTransferProvider(SPI_Devices.SPI1, Pins.GPIO_PIN_D10,
Shifter74Hc595LcdTransferProvider.BitOrder.LSBFirst);
// create the LCD interface
var lcd = new Lcd(lcdProvider);
// set up the LCD's number of columns and rows:
lcd.Begin(16, 2);
// Print a message to the LCD.
lcd.Write("hello, world!");
while (true)
{
// set the cursor to column 0, line 1
lcd.SetCursorPosition(0, 1);
// print the number of seconds since reset:
//lcd.Write((Utility.GetMachineTime().Ticks / 10000).ToString());
//Thread.Sleep(100);
}
}
}
}
The LCD is lighting up, and if I adjust the contrast the first line of the LCD moves from either solid blocks to blank screen.
Hello,
I have one problem, after connecting all like in tutorial. With full contrast i have only visible second line of white block. Does someone know why first line of blocks didn't appear ?
Regards,
Pater
Edit:
LCD has T6963C LSI controller with 8 bit parallel data bus instead of HD44780.
Hello,
I wrote a simple extension of Szymon's library adding some effect for displaying words, maybe someone finds it interesting.
pater
MFExtendedLCD.zip82.31KB49 downloadsDemoLCD.zip93.83KB52 downloads
Hi,
I´m trying to make to work the Adafrut I2C/SPI backpack with OLED display, using SPI.
I can see the same garbage in the display, every time.
This OLED display work good with GPIO wiring.
What I am doing wrong?
Regards, Pablo.
I just assembled an Adafruit I2C Negative RGB LCD shield, but didn't get a chance to play with it.
It seemed fairly easy to connect. Try checking out Stefan's Toolbox I am sure that he has some great sample code included with it. Adafruit RGB LCD Display
It is always good to include pictures but I could not see enough to help.
If you can provide information on the OLed display or a link. The code would help if you can list or attach it.
I´m trying to make to work the Adafrut I2C/SPI backpack with OLED display, using SPI.
I can see the same garbage in the display, every time.
This OLED display work good with GPIO wiring.
What I am doing wrong?
Regards, Pablo.
Can you share some of your code so we can help debug the issue. I've used the backpack with several displays using both I2C and SPI and it worked fine.
I just assembled an Adafruit I2C Negative RGB LCD shield, but didn't get a chance to play with it.
It seemed fairly easy to connect. Try checking out Stefan's Toolbox I am sure that he has some great sample code included with it. Adafruit RGB LCD Display
It is always good to include pictures but I could not see enough to help.
If you can provide information on the OLed display or a link. The code would help if you can list or attach it.