Jump to content
Rei Vilo

[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

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

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!

Share this post


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

Share this post


Link to post
Share on other sites

Hi!

 

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.

Share this post


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.

Share this post


Link to post
Share on other sites

@@Rei Vilo Is that the Kentec lcd?

 

Not yet! The screen pictured is the HY28A 320x240 2.8", with high quality colours and a very affordable price at USD12.

 

I'm working right now on the Kentec 3.5" parallel interface. It should provide a faster and more responsive interface.

Share this post


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.

 

post-12238-0-11577700-1373724197_thumb.jpg

 

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

Share this post


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.

 

post-389-0-76654200-1373897710.jpg

 

 
Remember, the Kentec 3.5" BoosterPack requires a LaunchPad Stellaris.
 
 
This is a cross-post with the Stellarisiti forum.

Share this post


Link to post
Share on other sites

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.

 

post-12238-0-36720000-1382884805_thumb.png
 
:smile:
 
This is a cross-post with the Stellarisiti forum.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×