I have this LCD https://www.sparkfun.com/products/14073, and I use it with a software serial library. The firmware is v1.1. The settings codes (including setting the cursor position) work fine, but I always see a “blocky” rectangle at the current cursor position, which I don’t like. In a different Sparkfun display I have https://www.sparkfun.com/products/10097, I see no such cursor
Hi there, and thanks for your question.
Sounds like you need to disable the cursor. By default it’s off but you may have accidentally turned it on while you were working on your display.
Example 5 in the library has a few commands that should work for you. You’re going to want to send the command for turning the cursor off, which is lcd.noCursor(); and if you ever need it back send lcd.cursor(); to turn it back on.
TS-Chris:
lcd.noCursor();
Thanks for the reply. I use a Software Serial library (not your SerLCD library), so I need to know the actual serial codes. In your OpenLCD firmware->Examples->Serial->#7 Serial Cursor Type, I see this:
OpenLCD.write(254); //Send command character
OpenLCD.write( (1<<3) | (1<<2) ); //Display on, cursor off, blink off
In my code (C++), I do the equivalent, but I still see the cursor:
this->write(254); // send the special command
this->write((1<<3)|(1<<2)); // Display on, cursor off, blink off
// this->write((1<<3)|(1<<2)|(0<<1)|(0<<0)); // I also tried this, explicitly
The display bit seems to work i.e. the display goes blank, but not the cursor or blink codes:
this->write((1<<3)) // this turns the display off
I did a software reset (0x08), but it didn’t help. If the the cursor should be off by default, why is it still there after a reset?
Here are the defines from your SerLCD library:
#define LCD_DISPLAYCONTROL 0x08
#define LCD_DISPLAYON 0x04
#define LCD_DISPLAYOFF 0x00
#define LCD_CURSORON 0x02
#define LCD_CURSOROFF 0x00
#define LCD_BLINKON 0x01
#define LCD_BLINKOFF 0x00
OK, if you’re not using the library but are just sending serial, the following will change the cursor.
Send the command character (0xFE or decimal 254)
Then send one of the following.
0C = Screen on, cursor off, blinking cursor off.
0D = Screen on, cursor off, blinking box on.
0E = Screen on, cursor on, blinking cursor off.
0F = Screen on, cursor on, blinking box on.
In your case, you’d want to send
0xFE 0x0C
or
(254) (12)
(Red is the command character, blue is the command)
to turn the cursor off but leave the screen on.
TS-Chris:
0xFE 0x0C
Thanks. I tried sending 0xFE, then 0x0C (equivalent to what I was doing in my previous post), but the blocky cursor remains. Other codes (backlight, contrast, clear screen etc work fine). This is how the screen looks like after a “clear screen” command: I see the blocky cursor in the upper left, solid, not blinking (the tear below is just a small tear on the protective foil):
https://funkyimg.com/i/2Vnkr.jpg
Seems like I have two options now: 1) try to flash the firmware with the latest v1.3, 2) replace the whole LCD. As far as flashing, I’ve just ordered your FTDI breakout https://www.sparkfun.com/products/13746, but I also found an old USB / FTDI cable lying around (see pic below), labeled “TTL-232R-5V”. Can I us this cable to flash the firmware? My guess the answer is no, since the LCD works with 3.3V: https://www.sparkfun.com/products/14073
A firmware update should correct this so that 0xFE 0x0C turns the block off. I’m not entirely sure how it got changed, but the new firmware will allow it to be turned off.
You really need a 3.3 volt FTDI to program the display as a 5 volt one would likely damage the display. You could connect a voltage regulator and level shifters to the 5 volt cable, but it’s probably a lot easier to just use the Beefy 3 when it arrives.
Finally resolved this, it was my fault. I got the Beefy, updated firmware to v1.3, but the blocky "cursor" was still there. I then found out that for the software serial (driving the LCD) I inadvertently used pins that shared a port I was initializing in an obscure part of my code. It wasn't a cursor, but some gibberish sent to the LCD RX pin right after "clear display", during port initialization, and displayed as a rectangle. I switched the pins and all is OK now. Thanks for your help.TS-Chris:
A firmware update should correct this