Coder Social home page Coder Social logo

openlcd's Introduction

OpenLCD

SparkFun 16x2 SerLCD - Black on RGB 3.3V (LCD-14072) SparkFun 16x2 SerLCD - RGB on Black 3.3V (LCD-14073) SparkFun 20x4 SerLCD - Black on RGB 3.3V (LCD-14074)

These AVR-based Serial Enabled LCDs are based on the HD44780 controller, and include an AVR ATmega328P with an Arduino compatible bootloader. They accept control commands via Serial, I2C and SPI.

This repo contains the firmware that runs on the SerLCD hardware. If you are looking for the Arduino Library to talk to these devices please go here.

And thank you to all those that helped make OpenLCD better:

  • fourstix - Creating an Arduino library to drive OpenLCD directly, added pipe character escaping
  • makinako - Changing EEPROM writes to updates to reduce NVM wear and tear
  • ALittleSlow - Fixed logic bug on ignoreRX

Repository Contents

  • /Firmware
    • /Examples
    • /OpenLCD

Documentation

Product Versions

  • OpenLCD
    • LCD-14072 - SparkFun 16x2 SerLCD - Black on RGB 3.3V
    • LCD-14073 - SparkFun 16x2 SerLCD - RGB on Black 3.3V
    • LCD-14074 - SparkFun 20x4 SerLCD - Black on RGB 3.3V

License Information

The code is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round!

Distributed as-is; no warranty is given.

openlcd's People

Contributors

alittleslow avatar bboyho avatar fourstix avatar lewispg228 avatar loricrotser avatar makinako avatar nseidle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openlcd's Issues

Characters being deleted when changing backlight?

Getting a weird bug whenever I try to change the backlight over I2C. Any time I do so, the screen will delete a character, usually the last one from the current message, though repeating the change will delete more and more characters. Any idea why this is happening?

Display Customer Character function accepts 9 when only 8 custom characters are allowed.

Issue:
Fence Post error (Off by one error) in OpenLCD.ino, line 226, display customer character function.
Fix:
Change the upper limit from 43 to 42, the if statement should allow 35 to 42, inclusive since only 8
customer characters may be defined.
Severity: Low/4/Might Fix
Justification:
The underlying function will map the invalid request for customer character 9 to custom character 0, so the impact is minimal. Fixing this problem may make the code more robust and prevent possible future problems.

Obligatory XKCD reference:
https://xkcd.com/1110/
Click and drag the last panel to reveal the following text:
If you are having fence post errors,
I feel bad for you son -
I got 99 problems, but
somehow solved 101.

Reduce the number of EEPROM writes with a 'Save Settings' command or EEPROM.update

EEPROM.write is used all over the place to save settings on-the-fly (without an explicit 'save settings' command). Since sketches will mostly configure the SerLCD in setup(), this means that every time the sketch starts (at least) it is writing to the EEPROM a number of times for Backlight, Contrast, etc. It also dramatically slows the operation down.

Two solutions:

  1. Simply change all calls for EEPROM.write to EEPROM.update, which will check if the value has changed first
  2. Remove all the calls to EEPROM.write and have a specific 'Save Settings' command, so that all changes occur only in RAM unless persisted.

Option 2 is the more performant one, but Option 1 is probably preferred because of compatibility.

Implement version number

As we (or super cool customers like @fourstix) add new features we should have a firmware version that is accessible via command so that tech support can know which firmware is loaded onto unit. This will probably be a define up top along with a new command to get display to show version number.

Persistent faint blue backlight when backlight is set to off (0,0,0) and on initial power on.

Although it is not noticeable in the daytime, there is a constant very faint blue backlight on my unit. This occurs on startup, and also persists even after setting the backlight to 0x00, 0x00, 0x00 with the provided sample code (write: |, -, |, +, 0x00, 0x00, 0x00).

This is over i2c. All other functions seem to perform fine. This has been tested both with direct I2C commands and with the SerLCD library.

Please add a command to disable serial input

I would like to request a new command to ignore serial input (separate from the "ignore-RX on reset"), which would have the controller ignore anything happening on the serial RX line. (It should be "volatile" in that it goes away whenever the display is reset or power cycled, IMHO.) To maintain symmetry (always a good idea) there should also be disable commands for SPI and I2C. (At the risk of pointing out the obvious, if these were "non-volatile" [as is the "ignore-RX on reset"], it would be too easy to "brick" the processor, thus best to make them "volatile".)

For "why", please see this Forum thread: https://forum.sparkfun.com/viewtopic.php?f=63&t=53788

Please reset mode between I2C transactions

The start of an I2C transaction needs to be in a defined mode. That or there needs to be a sequence of bytes that, in all modes, resets the state.
If it's not (and as it stands, from what I can see), it is completely impossible to make a reliable driver for this product. Yes, it may work 99% of the time, but it cannot be made reliable.
Right now, there is no 'correct'.

Pinout different than previous backpacks?

Hey Nate,
I am working on the testbed for these right now. I noticed that the pinout for the connections to the LCD are slightly different than our previous backpacks. There are two extra pins (GRN and BLU).

Where on the LCD are these two pins intended to be connected?

image

image

Three Files with the Extension .ino prevent compile in Windows.

The firmware consists of several files, three of which have the extension .ino. Yesterday I bought a 20x4 SerLCD and this has the known backlight bug in the firmware. On your side the procedure is described very well, but I could not compile the firmware under Windows 10, because only one file may have the extension .ino. Trying to rename the files to header files caused several problems. So I installed everything under Debian Linux and the three files with the extension .ino don't interfere! I forked the firmware and uploaded the binary file in the fork, because you fixed the bug but didn't upload a binary file. It's not that bad, but just to fix the bug, the steps are too extensive for most users.

https://www.youtube.com/watch?v=OjE9r5SRFKM

design review for proto v02

  1. Is the version number correct? [NO]
    comment: should be v02 in sch

  2. Does it pass SparkFun DRC? [NO]
    comment: You're really close to passing the STANDARD DRU, please use this and approve the errors caused by the locking header pads getting close to dimension

  3. Do all packages have NAME and VALUE? [NO]
    comment: please change u3's value to MIC5205, rather than just ADJ

  4. Is the polarity label outside of the package for visibility after part population? [NO]
    comment: Please update package for mcp4725 to have polarity mark outside package

Internal i2c pull up on LCD-14074

I've run across a reference somewhere that OpenLCD uses a 4.7k internal pull up resistor on SDA/SCL, but that reference was for non-RGB older versions. The hookup diagram on sparkfun makes no mention of any internal pull-up (OR how to disable it).

Does this pull up exist and if so how can it be disabled?

Ability to set 'ignore RX', set contrast, set RGB without writing EEPROM

In my application, I do not need the device to write to EEPROM -- really, for anything. I expect to be streaming 'set RGB' quickly to do fades between colors (for example, fade white to red when an error occurs, fade back afterward), and this will certainly wear the EEPROM out if it writes it.

It would be very helpful to have a pair of commands to disable/re-enable EEPROM writes when changing settings. (These would be sent during initialization and so should not themselves be saved.)

Thank you!

James

'Ignore RX' needs to set true or false...

Right now, it toggles.
Toggling is completely useless and wrong.
This means it cannot be sent as part of a SPI or I2C startup. If the host board restarts for whatever reason, while keeping the device powered (this will certainly happen), the host board will turn OFF 'Ignore RX'.

(More a question than bug report)

I don't know an easier way to get in touch with you about this display.
I use Node-Red on a RasPi.

I have a display which I have been told is covered by this bit of software.

Alas I think what you have is for Arduinos / etc, and not for Node-Red.

No problem.

The RasPi and the display are 3.3v, so that is good.
I got it, hooked it up and used someone else's node but it would seem I have opened a can of hurt.

I am wanting a node to talk to this display and send it commands like:
backlight (on/off)
cursor (on/off)
blink (on/off)
and x/y positioning for text.
Though if the x/y is missing, it just prints at the next position.

Could you help me?

Erroneous messages on display when adjusting back light

After a lot of work, I got the display working.

Attached video explanation:

The display is showing me the time/date/day of week.
And there are a couple of problems visible that the messages are not quite working as they get their positions wrong now and then.
(That's probably an I2C noise issue. But it is not this problem)

So the display has a backlight of 255,255,255. Though the colour is not exactly correct as you see it, I think that is more to do with the angle at which is it viewed. However, the problem will become apparent when you continue watching the video.

I have opened a python (2.x) shell and typed in all but the last command shown here, now.
There is no implication that python3.x is supported or there is even a 3.x package available.

`
pi@alarmclock:~/.node-red$ python
Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from future import print_function
import qwiic_serlcd
import time
import sys
myLCD = qwiic_serlcd.QwiicSerlcd()
myLCD.setBacklight(150,0,0)
`

You see the display happily showing the time.

I enter the last line: myLCD.setBacklight(150,0,0) and watch what happens.

The display colour changes. Not once, not twice but many times.
Simply from me entering the ONE command.

Also see the a colour name top left.
Nothing to do with the colour of the backlight.
Then towards the end you see the screen is covered with numbers.
My suspicion is that is the time being forced all over the place.

So, problems - as I see them:

  • There is a backlight command. You enter it with a r,g,b parameter and it shows you a whole bunch of back ground colours.
  • When the back ground colour is adjusted a random/nominal colour name is printed on the screen. Top left.
  • I have tried the contrast command and looking at the screen, I can't see any changes.
    It isn't documented how to use other than something like: The lower the number, the higher the contrast.
    Ok, so if you want a high contrast display, enter 0 - I guess.
    It doesn't say if the LOWEST number is 0 or 1.
    And what is the highest number?
    (Maybe this is a documentation problem and not for here, but I am quite happy to create a bug report there IF I can find the link.)

LCD.zip

Design Review v01

  1. On a lot of boards we have been grounding CTS on the FTDI header. Shouldn't this be grounded on this design too?

  2. MISO tri-state buffer? Wanna talk to Grusin?

  3. 3 GND flags should be symbols. Also, 2 gnd symbols off of left side of 328 should be orientated downward.

  4. Use VCC symbol on VCC net off of U2

  5. move designer name to tdocu

  6. BLU and GRN text labels are lower than the rest, may as well get them lined up

  7. 4 acid traps

image

Turning off system messages

I cannot find anywhere in the documentation on how to turn off system messages.
I have also dig through the code a bit and at a glance it does not look like a command of that nature exists.

When using the example code below:

  Wire.beginTransmission(LCD_1_ADDR); // transmit to device   
  Wire.write('|');
  Wire.write(128);
  Wire.write('|'); 
  Wire.write(187);
  Wire.write('|'); 
  Wire.write(188);
  Wire.endTransmission(); //Stop I2C transmission

This will then display three separate messages on the LCD.

Libraries for Reuploading the Default Firmware

It would be nice to include the additional libraries used for the default firmware in the repository. =) If not, it would be nice to include a link them somehow. I bricked the OpenLCD when trying to upload code to another Arduino. The pins were on the same hardware UART line. Doing a search online, I found the libraries:

SoftPWM library => https://code.google.com/p/rogue-code/wiki/SoftPWMLibraryDocumentation#Download

LiquidCrystalFast library from PJRC => https://www.pjrc.com/teensy/td_libs_LiquidCrystal.html

Display stops responding above 32 byte writes

More than 32 characters crashes the display. I've not had a chance to investigate further but it is consistent. This is a problem for those of us doing DMA writes of the entire screen.

Use a separate command for writing flash

Having a multi coloured display is a real bonus, I can use it to indicate errors and the like.

But if I flash/change colours a few times that's a couple writes to EPROM, and the 100,000 count will eventually be used up. It also slows the whole system down by locking the CPU while it writes.

Solution is to remove the auto-save and map it to a character in the 0x0 to 0x20 region, or add it to the command options.

Checksums or similar for critical commands

Hello,
Would you please consider requiring a checksum, or at least a duplicate byte, for critical commands?
For example, if a bit flip causes the 'change I2C address' command to be called, the hardware that uses the device is no longer usable. End users can't be expected to fix such a problem, either. The commands, as they stand now, have this introduced source of unreliability.
Thanks!
James

Create library

We should really write a library for this device. It would be much easier if a .begin() function took a TwoWire, Serial, or SPI stream and then over-wrote the .print function. We did this on the Qwiic OpenLog product.

Better code for Basic Hello

I have found that the "hello" is impossible to see as the contrast settings are wrong on my hardware...likely this will happen to others...my fix.

uint8_t fullgreen = 0xBB;
uint8_t fullcontrast = 0x18;
uint8_t zerovalue = 0x00;

Serial.begin(9600); //Start serial communication at 9600 for debug statements
Serial.println("OpenLCD Example Code");

OpenLCD.begin(9600); //Begin communication with OpenLCD

//Send the reset command to the display - this forces the cursor to return to the beginning of the display
OpenLCD.write('|'); //Send setting character
OpenLCD.write('-'); //Send clear display character
OpenLCD.write('|'); //Send setting character
OpenLCD.write(fullgreen); //full on green
OpenLCD.write('|'); //Send setting character
OpenLCD.write(fullcontrast); //full contrast
OpenLCD.write(zerovalue); //full contrast

OpenLCD.print("Hello World! Counter: "); //For 16x2 LCDs
//OpenLCD.print("Hello World! Counter: "); //For 20x4 LCDs

Add function for printing the pipe character to the serLCD display

Currently pipe | is used as the command setting character, and printing a string with a pipe character may accidentally invoke a display function. There currently is no way to print a string with a pipe character to the display.

Adding logic to allow pipe to be double escaped || would allow the user to print a pipe symbol as a character in a string without accidentally invoking a display command.

No Complete command list

I can't seem to find a complete command list anywhere - the readme says nothing about commands, and the examples only include the "cheat sheet" list, even the ones that use commands that aren't on it (like custom characters).

Set RGB Backlight in one command without flicker

Add function to update RGB backlight as a single settings command followed by 3 bytes for the red, green and blue values. This will eliminate the delays and flickering of using 3 commands to set the colors, one by one.

This command has a few advantages over the original.

  1. It changes the backlight color at once, with no flickering through intermediate colors.
  2. It's quicker and a bit more intuitive to use a single command.
  3. It allows for all rgb value combinations, not just those that map to a 0-30, 0-30, 0-30 triplet. (Probably not a big deal, as maybe only an artist who has mastered like Monet, might be able to notice the difference.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.