This isn't a request for help; I'm sharing work with the community in the hopes that it helps someone else in a similar scenario. Free to use as you wish, and I take no responsibility for any issues you have with it.
I'm doing work with a µcontroller that doesn't have tons of pins to spare for an LCD, so I decided to use an LPC832 as a 16x2 LCD driver over SPI, to reduce the number of pins needed on my main controller. I came up with this, and it seems to work pretty well, so I thought I'd share. I tested it with Bus Master 5's SPI mode, and it responded appropriately, but you'll have to test it with your environment.
Untar the "tgz" file, import it into MCUXpresso as a new project, connect your pins as shown in the illustration, and it should work. It uses "command" bytes to indicate what action you want to take:
0 = clear; sub-command 0 - entire screen; 1 - the current line
1 = goto; row col
2 = print; sub-command 0 - single character; 1 - string
3 = LCD display command; command bytes relevant to your LCD display
anything else is ignored
Commands and operands are separated by spaces, so "0 0" clears the entire screen. "2 1 ascii bytes" prints a string at the current LCD position. "1 1 0" goto row 1 (second row; counting from offset 0), position 0.
This is configured for 16x2, but it wouldn't be hard to adjust for bigger screens.
Thanks to @ErichStyger for his HD44780 library, on which this is partially based.
https://github.com/ErichStyger/McuOnEclipseLibrary/blob/master/lib/HD44780/McuHD44780.c
Solved! Go to Solution.
Hello, thanks for your contribution on the community.
Best regards,
Pavel
Hello, thanks for your contribution on the community.
Best regards,
Pavel