Jump to content

[Energia Library] LCD_screen Library Suite

Recommended Posts

Just a quick update on the LCD_screen Library Suite.


Development is going well with all the graphics now included and tested: clock, gauge, yaw, pitch, roll, histogram, table, ... All the calculations are done using integers to avoid spending 6KB for the real library.


The only problem is the library suite no longer fits into a MSP430G2553, mainly due to the fonts on Flash. Also an issue, managing the 512 bytes of SRAM to avoid any overflow.


So I'm targeting the LaunchPad Stellaris first but I'm considering adding a SPI EEPROM for fonts, so the library could be used on the MSP430G2553. This is the standard way of downsizing.


Another addition would be fast SRAM, provided the screen features pixel reading, to enable saving the screen before showing a dialog box or a menu, and restoring it after. 


I hope the new MSP430s with more memory

Link to post
Share on other sites
  • Replies 80
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi!   I've decided to consolidate the libraries I've developed for different screens into a single one, the LCD_screen Library Suite. Download with examples and documentation is available here. T

Please find a special release of the LCD_screen library for Rob's Color LCD Booster Pack (320x240 with microSD card socket) on Energia.   The LCD_screen Library Suite has evolved with a more mature

Thanks for taking the initiative.

Posted Images

Release 105 is available with all the graphics from the previous Serial_LCD Library Suite: clock, yaw, pitch, roll, gauge, histogram, table.


Basic functions as drawing lines, rectangles, circles and displaying text fit into the MSP430G2553 memory, both flash and SRAM. However, advanced graphics require more space and thus the Stellaris LM4F.


On the next iteration, I plan to explore and add the SRAM support for the GUI environment and explore the fonts on EEPROM.


Enjoy :smile:

Link to post
Share on other sites
  • 4 weeks later...

Two news about the LCD_screen library suite:

  • Using SPI SRAM was more difficult than expected.

The fast RAM allows to save the initial screen before a dialog box or a menu is displayed in order to restore it after. A basic 320x240x16-bit screen requires 153,600 bytes or 150 KB.


Using the 23LC1024 is rather difficult on a breadboard and prone to interferences. Only slow SPI speed works, even with decoupling capacitors and pull-up resistors. I haven't experienced such problems with the 23K640.


So I'm considering using a SD-card instead. The main benefit of a SD-card is the flexibility, as it allows larger space at the expense of being slower than SRAM.

  • I've started exploring the Kentec 3.5" BoosterPack for the LaunchPad Stellaris. 

This is a very nice screen. I'm learning how to deal with an 8-bit parallel port on Energia and I'm digging into the LCD controller specification sheet... 


I only need to fix the hardware interface. All the graphic and text routines are ready as they are shared with the other screens. 


Stay tuned!

Link to post
Share on other sites

My project uses "Color LCD Booster Pack (ST7735R)" with the SD card slot. Please implement support for SD cards in your library!


Examples of "LCD_screen_105" not work in "Energia 0101E0009"! Errors appear:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0
	at processing.app.Sketch.setCurrentCode(Sketch.java:1184)
	at processing.app.Sketch.load(Sketch.java:222)
	at processing.app.Sketch.<init>(Sketch.java:144)
	at processing.app.Editor.handleOpenInternal(Editor.java:2187)
	at processing.app.Editor.<init>(Editor.java:304)
	at processing.app.Base.handleOpen(Base.java:714)
	at processing.app.Base.handleOpen(Base.java:679)
	at processing.app.Base.handleOpenPrompt(Base.java:668)
	at processing.app.Editor$4.actionPerformed(Editor.java:497)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
	at java.awt.Component.processMouseEvent(Component.java:6263)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6028)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4630)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Best Regards,

Igor Isaias Banlian, from Brazil

Link to post
Share on other sites



I'm not using the Energia release energia-0101E0009 but a compiled version I've built using the code source. See Build Energia on how to proceed. The code source includes many fixes.


The problem with the SD-card is the MSP430G2553 doesn't have enough RAM. So it's going to be a feature for the LaunchPad Stellaris. I plan to use the Stellaris Launchpad FatFs Energia library.

Link to post
Share on other sites

Good news! The LCD_GUI library is available and brings the usual elements of a graphic interface as: label, button, dialog box, menu, slider and text box.


The project is based on a LaunchPad Stellaris, a HY28A touch screen and 2x 1Mb of SRAM, and should cost less than USD35. The SRAM is used as a fast cache for the screen.


Learn more about the project and the LCD_GUI library.

Link to post
Share on other sites

The library for the Kentec 3.5" is close to completion. Please note this BoosterPack requires the LaunchPad Stellaris.


Thanks to its 8-bit parallel connection, writing to and reading from the screen are much faster!


49 ms only to copy-paste a 64x64 area instead of the 438 ms required by the SPI-connected HY28A.




I have still to finalise the touch interface and obviously the documentation...

Link to post
Share on other sites

The library for the Kentec 3.5 BoosterPack is available here


The library wouldn't have been possible without the help of the forum and its members. Many thanks to them!


As a colourful example, I've included a tool for drawing.




Remember, the Kentec 3.5" BoosterPack requires a LaunchPad Stellaris.
This is a cross-post with the Stellarisiti forum.
Link to post
Share on other sites
  • 3 months later...

Thanks to the 43oh forum, I received one 4D Systems uLCD-32WPTU screen with BoosterPack for Stellaris LaunchPad to test.


It is an all-in-one screen module featuring touch, SD card, built-in fonts and speaker.


Please find my review and the updated LCD_screen Library Suite for Energia.


This is a cross-post with the Stellarisiti forum.
Link to post
Share on other sites

Release 113 of the LCD_screen Library Suite includes a sketch to measure the speed of the screens.


It provides the same protocol to compare how fast or slow the screens display texts and graphics.


Here are the first results:




blank = not available


This is a cross-post with the Stellarisiti forum.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...