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.

sjmill01's Content

There have been 13 items by sjmill01 (Search limited from 26-April 23)


By content type

See this member's

Sort by                Order  

#65568 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 14 August 2016 - 12:28 PM in Netduino Plus 2 (and Netduino Plus 1)

Interesting, that code looks to be using 0x3f as the address.
 
Have you tried the code you found with MICROSOFTWAY defined to use the NETMF libraries or are you just using the software I2C?
 
Regards,
Mark



I changed 3f to 27 to match my i2c address. Also I took out the register option so it wouldn't scroll. I'm only using the software i2c that he posted.

See ya,
Sean



#65566 N2 + I2C 1602 LCD

Posted by sjmill01 on 13 August 2016 - 11:53 PM in Netduino 2 (and Netduino 1)

I know this is an old post, but I was fighting getting a LCD to work with I2C until I found this code.  So, I thought I'd post the solution for others.

 

 

I found the reason your display was not performing well.  It has some bits set for scrolling.  So, you can add spaces to the end of the text to be sure it scrolls enough.

 

Or, change this line:

command((byte)Registers.CMD_Entry_Mode | (byte)RegisterOptions.OPT_Increment | (byte)RegisterOptions.OPT_Display_Shift);

to this...

command((byte)Registers.CMD_Entry_Mode | (byte)RegisterOptions.OPT_Increment );




#65565 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 13 August 2016 - 11:40 PM in Netduino Plus 2 (and Netduino Plus 1)

Finally got it working. 

 

 

I didn't need the voltage level shifter after all as it seems that the LCD will allow for 3.3V logic level.

 

The problem was compatibility of the code.

 

I found this post and its code worked for me:  http://forums.netdui...2-i2c-1602-lcd/

 

This code still has some issues, but at least I could get text to the screen.  The problem is that it has something odd going on due to scrolling.




#65563 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 12 August 2016 - 04:48 PM in Netduino Plus 2 (and Netduino Plus 1)

Have you tried moving the address 1 place to the left ?

Regards,
Mark

 

Tried shifting the address and it did not work.  (Used 0x4E instead of 0x27)

 

I found that if I don't put power to it until just before the creation of the LCD object, it does talk. 

 

The code that writes the bytes to the I2C bus returns the number of bytes written.  When I change the address, it returns 0 bytes written.  So, I'm sure its talking and has the right address (0x27).

 

I now have a voltage level shifter and each side of the level shifter are showing the correct voltage.

 

Perhaps the bytes being sent are not right in my microliquidcrystal class?  Oddly, I can't manipulate the backlight with lcd.Backlight, but when I try to write "Hello world", I see only the blocks, but the backlight turns on. 

 

Are 4 bit and 8 bit modes.  Could that be the problem?

 

Thanks,

Sean




#65539 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 11 August 2016 - 01:26 AM in Netduino Plus 2 (and Netduino Plus 1)

Well, I bought this  https://www.sparkfun.../products/12009

 

to convert my 3.3V logic to 5V logic.

 

Unfortunately, still didn't work.

 

I even bought a separate device that claimed to be Raspberry Pi compatible...but it was not.  It was similar to the first one I bought, but also works with Arduino.

 

I'm thinking it has to do with the code in microliquidcrystal.

 

How are people changing the code to change the I2C device address?  I changed it in the MCP23008Expander code.




#65489 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 04 August 2016 - 11:15 PM in Netduino Plus 2 (and Netduino Plus 1)

Not sure if a transistor would but if you look at some of the schematics for Adafruit devices (say BME280) I'm sure they use FETs on the data lines for logic level shifting.

 

Regards,

Mark

 

I validated that the LCD does work on an Arduino.  So, I'm pretty sure its the voltage mismatch.

 

Found this great tutorial on how to achieve the logic level conversion using a MOSFET based level shifter.

 

https://learn.sparkf...evel-converter?

 

Feels like a Bethesda game with all these side quests.  :)

 

I'm determined to get this working no matter what the costs.  I don't want to waste my $2 dollars on its purchase.




#65487 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 04 August 2016 - 11:32 AM in Netduino Plus 2 (and Netduino Plus 1)

If you only need to send data to the LCD then you could consider trying to convert the 3.3V to 5V using a transistor.  Not sure if that will work.

 

Neat concept.  Would the tranistor be on the I2C lines?  If so, would I need to use a diode to allow for two way traffic so it could get around the transistor on the way back?

 

Thanks,

Sean




#65478 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 04 August 2016 - 02:28 AM in Netduino Plus 2 (and Netduino Plus 1)

I just searched for 3.3V compatible boards.  I believe Raspberry Pi is 3.3V.  I keep finding Arduino/Raspberry pi boards that are 5V powered that look like mine.  This makes me think that the one I have would work.

 

So, my new question is, can someone paste a link to an LCD they got to work on the Netduino?




#65477 XBee Shield for Netduino

Posted by sjmill01 on 04 August 2016 - 01:32 AM in Project Showcase

Made a custom shield for an XBee to control my R2D2.  Sharing for inspiration...

 

https://www.youtube....h?v=fcXi3bTEgQI

 

See ya',

Sean

 




#65476 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 04 August 2016 - 01:22 AM in Netduino Plus 2 (and Netduino Plus 1)

Arduino compatible does not mean it will necessarily work with Netduino due to the differences in the logic levels.

 

Netduino logic levels are 0 - 3.3V for output but they will tolerate 5V on input.

 

Arduino levels are normally 0 - 5V for both input and output.

 

So, does the LCD require 5V logic levels or is it designed to work with 3.3V logic?

 

Regards,

Mark

Thought this would be a winner, but the datasheet stated the backpack is good from 2.5V to 6V.  However, the LCD itself could be 5V.  So, I sent an email to China to find out.

 

Perhaps this explains why I get a byte count back after making the I2C execution.  Its backpack is fine with 3.3V, but the LCD is not.

 

I just tried using 3.3V to power the whole thing and it just responded the same.

 

So, we'll see.  Thanks for the advice.  I'll post what I find (while I purchase a 3.3V LCD in parallel).

 

See ya',

Sean




#65462 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 02 August 2016 - 11:31 AM in Netduino Plus 2 (and Netduino Plus 1)

Few things spring to mind:

  1. Does the device have a contrast potentiometer?  I have seen displays show rectangular blocks when the contrast is turned up too high.
  2. The LCD is supplied with 5V according to the ebay page.  Is the I2C logic also 5V?  The Netduinos only supply 3.3V logic.
  3. Might be worth left shifting the I2C address 1 lace left as an experiment.  I can't remember if the I2C library in .NET does tis for you or if you have to do it yourself.  For those who aren't aware, bit 0 is the read/write indicator bit and the address goes into the top 7 bits.

Regards,

Mar.

It does have the contrast pot, but it doesn't resolve it.  I'm just trying to turn on the backlight now for 1.5 second cycles.

 

The LCD claims Arduino compatible and I'm pulling up the I2C lines to 3.3V.

 

I'll dig into left shifting tonight.  Looking through the microliquidcrystal, it looks pretty complicated in that code.

 

See ya',

Sean




#65455 16x2 LCD I2C Netduino Plus 2 Not Working

Posted by sjmill01 on 02 August 2016 - 02:21 AM in Netduino Plus 2 (and Netduino Plus 1)

I've spent about 8 hours over the last week combing the forums and the general internet for this issue and found many have trouble with LCDs, but few posts end with a resolution.

 

I have this Arduino Compatible I2C LCD: 

http://www.ebay.com/...=STRK:MEBIDX:IT

 

I am using the microliquidecrystal library:  https://microliquidc...l.codeplex.com/

 

I aligned to 2.2K resistors to pull up the SC and SD pins of the Netduino after experimenting from 10K down to 33ohms.

 

I power the LCD until just before initialize the lcd object (I do this with a break in the debugger).  I do this to prevent the issue others have seen that result in no communication and a resulting exception thrown.

 

I changed the microliquidcrystal class to use an I2C address of 0X27 instead of the 0x20 default as instructed on the EBay page. 

 

With each I2C call, the execute routines return the correct number of bytes communicated, so I imagine it's talking correctly.

 

However, on the LCD I just get a continuous row of full blocks and the backlight flickers with each call.

 

I have played with the contract potentiometer on the back of the module to ensure its not just washing out.  It's not.

 

In the code below, I tried simply turning the backlight on and off every 1.5 seconds, but it still just flickers versus staying on.  Trying to write text does nothing but flicker the backlight.

 

What could be left to try?  I'd be happy just to turn the backlight on and off under my control.

 

Is it because I'm not using Adafruit's backpack?  If so, how do I learn to send I2C commands that will work with this backpack?


// Micro Liquid Crystal Library
// http://microliquidcrystal.codeplex.com
// Appache License Version 2.0
 
using System.Diagnostics;
using System.Threading;
using FusionWare.SPOT.Hardware;
using MicroLiquidCrystal;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
 
namespace HelloWorld_I2C
{
    public class Program
    {
        public static void Main()
        {
            // Option 1: Use I2C provider.
 
            // initialize i2c bus (only one instance is allowed)
            var bus = new I2CBus();
 
            // initialize provider (multiple devices can be attached to same bus)
            var lcdProvider = new MCP23008LcdTransferProvider(bus);
           
            // create the LCD interface
            var lcd = new Lcd(lcdProvider);
 
            // set up the LCD's number of columns and rows:
            lcd.Begin(16, 2);
 
            while (true)
            {
                lcd.Backlight = !lcd.Backlight;
                Thread.Sleep(1500);
                Debug.Print("Derp.");
            }
        }
 
    }
}

Thanks,

Sean




#64180 XBee Shield for Netduino

Posted by sjmill01 on 22 September 2015 - 10:09 AM in Project Showcase

My son and I made a video to inspire kids his age to get into electronics.

 

In the video, we designed and fabricated a shield for a Netduino to connect an XBee radio to it.

 

 

See ya',

Sean





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.