GUIs on 8-bit AVRs

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is a bit of a 'thinking aloud' post...

 

Over the past 12 months or so, the price of 7" LCD displays with integrated touchscreens has dropped to level where it is now feasible to replace traditional "button, LED and LCD" front panels with them on industrial embedded systems. However, I feel that whereas an 8-bit AVR will happily run the older style panel, they will struggle with running any sort of GUI.

 

I'm not necessarily thinking about Windows 8 quality, nor Windows XP. Probably something like Win3.1...

 

 

...but better than GEM (remember that?)...

 

 

...would suffice.

 

But would an 8-bit AVR handle it?

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

..but better than GEM (remember that?)...

It's just vaguely possible you could say I was instrumental in it becoming popular. Amstrad chose to ship GEM with our original PC1512 which sold several million units in the UK so a lot of people who do know GEM know it from our PCs:

 

Unfortunately corporate customers said they weren't interested in DR-DOS (Digital Research's "better" version of DOS) and they weren't interested in GEM so before long we joined the herd and shipped MS-DOS and early Windows 3.0 versions. (It could have been Windows 2.0 in fact - they switched around that time).

 

Anyway as I mentioned in another thread about GUIs the other day I designed/wrote this:

 

http://upload.wikimedia.org/wikipedia/en/2/2a/Amstrad_PCW_16_01.png

 

that's all done in Z80 Asm and was running on a 6MHz Z80. So, yes WIMP (Windows , Icons, Menus, Pointer) can easily be done on a low end 8 bit. HOWEVER the storage space for all the "widgets" and "fonts" could be an issue. The problem you face in an AVR is (a) relatively low flash space and perhaps worse (b) abysmally small RAM space to work in.

 

For (a) I guess you could pick a 128K/256K or even 384K chip but another alternative might be to store fonts and graphics on an attached SD card perhaps? For (b) I'd start with mega1284P and its "huge" 16KB RAM but beyond that consider an AVR with an external bus interface to which a 32K/64K (or perhaps even bigger?) SRAM could be attached.

Last Edited: Mon. Mar 23, 2015 - 11:14 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I desired to make an AVR GUI, but went to using an Android tablet programmed with B4A, and bluetooth communications. Since then the CodevisionAVR C compiler has added significant support for many displays. I have no need to evaluate the libraries, so i have no direct experience.

Here is info from CodeVision website: The CodeVisionAVR Advanced version also features the LCD Vision Font & Image Editor/Converter and Graphic Display Libraries for the ILI9325, ILI9328, ILI9340, ILI9341, RA8875, S6D1121, SSD1289, SSD1963, SSD2119 (color TFT LCD), KS0108, SED1335, S1D13700, SED1520, SED1530, SH1101A (OLED), SSD1303 (OLED), SSD 1306 (OLED), SSD1322 (OLED), SPLC501C, ST7565, ST7567, ST7920, T6963C, UC1608, UC1701, XG7100 and PCD8544 (Nokia 3310, 5510)

It all starts with a mental vision.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not multi windowed, but probably good enough:

http://www.mikroe.com/visualtft

Only applicable with mikroElektronika compilers.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wrote an EEPROM Programmer with this concept in mind, to have available; fonts, images, etc. on EEPROM so that a small display device could take advantage of them.

 

[shameless plug]

it's available for download here

Right now I'm not making code available but if enough are interested I will.

[/shameless plug]

Happy Trails,

Mike

JaxCoder.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avra wrote:

...Only applicable with mikroElektronika compilers.

 

Thanks, and just their hardware as well by the look of it.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://segger.com/emwin.html

 

Or get an "intelligent" display...?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://segger.com/emwin.html

That looked interesting until I hit this page...

 

https://segger.com/pricelist-emw...

 

Maybe for some kind of commercial development but not for a bit of hobbyist "tinkering" surprise

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pricelist-emwin.html - free for NXP

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is this site wasn't an Atmel sales tool I'd say that was very interesting indeed. cheeky

 

(I just had a hunt round to see if Atmel maybe had some similar kind of deal to offer with some other embedded GUI library but as yet I haven't stumbled upon anything. You can see how this kind of thing would start to be the differentiator when it comes to choosing Cortex chips though. Probably fairly forward thinking on NXP's part).

 

EDIT: when you start googling things like "embedded micro gui library" you also hit things like this: http://www.st.com/web/catalog/to... so "Come on Atmel! get your skates on!".

 

EDIT2: Actually this looks kind of interesting:

 

http://ugfx.org/

 

http://wiki.ugfx.org/images/d/db/Frame_example_1.PNG

 

The page even says: "µGFX can run on just any platform. From an 8-Bit AVR to a full blown multi-core system."

Last Edited: Mon. Mar 23, 2015 - 05:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, both NXP and ST have been doing this kind of thing for many years. They also had (maybe still have?) free versions of the InterNiche TCP/IP Stack.

 

TI also have a graphics library for their chips.

 

Atmel do, indeed, seem to be behind the game here - though I haven't done a search of the "Atmel Gallery"...

 

Then again, Atmel were late to the Cortex party.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Mon. Mar 23, 2015 - 05:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
For (b) I'd start with mega1284P and its "huge" 16KB RAM but beyond that consider an AVR with an external bus interface to which a 32K/64K (or perhaps even bigger?) SRAM could be attached.
Precision Design Associates (PDA) has a demo for XMEGA (A1, B1, A3BU) on a 2.8in but it does not use much of ASF-GFX; it's a demonstration of a small Atmel cap touch controller.

PDA also has a 3.5in display with an 8bit MCU interface but that may be a work-in-progress for the demonstration software.

PDA's larger displays are for SAMA5 Xplained and such.

The NuttX RTOS has an AVR port, widgets, and a window manager that states reasonable flash and local SRAM usage; updating the NuttX AVR port is likely a significant effort then can start on the GUI.


28xx Series - 2.8in Projected Capacitance Touch

TM2801

http://www.pdaatl.com/tx28xx.htm#tm2801

http://asf.atmel.com/docs/latest/doxygen_mainpage/images/atmel.png

ASF-GFX

...

ASF-GFX is a graphic stack for Atmel MCUs.

http://asf.atmel.com/docs/latest/asf_gfx.html

(select "xmega" in the Device pull-down menu)

35xx Series - 3.5in Projected Capacitance Touch

TM3500

http://www.pdaatl.com/tx35xx.htm#tm3500

NuttX Real-Time Operating System

NuttX Widgets (NxWidgets)

http://nuttx.org/doku.php?id=wiki:graphics:nxwidgets

...

Small Footprint. NxWidgets is tailored for use MCUs in embedded applications. It is ideally suited for mid- and upper-range of most MCU families. A complete NxWidgets is possible in as little as 40Kb of FLASH and maybe 4Kb of SRAM.

...

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, basic answer is that you can do it, but it may take a bit.  If you want to roll your own, it depends on what level of hardware support you want.  While ASF has a graphics library, I've never been able to find the source code and it only looks as if it supports some Atmel products.

 

It is quite possible to drive anything from a QVGA display to a VGA display with an Epson S1D13781, although the startup sequence is a bit tricky to get right, the application notes are reticent on that part of life.  The same can be said for the SSD1306 LED driver (initialization sequence and a gotcha are on the adafruit site).

 

Once you get the display going, the main problem is that the RAM memory in an AVR is quite limited, so you'd need external storage for the linked list of graphics objects if you decide to implement a scheme with frames, panels, windows, text objects and the like.  Should be possible to do the deed in external SPI memory.  Something around a 256K would have enough flash, though.

 

The advantage of having chained objects is that drawing any one object can automatically redraw the child objects, which can be useful for overlaid windows.  Takes memory, though.  (extents, border, clipping window, colors, font pointer, child pointer, links to other objects at the same level, ancestor, and direct owner; that kind of thing.)

 

The higher level graphics routines can write to anything you have a driver for, depending on how you structure the software.  QQVGA (128 x 64) also works.

 

The practical limit on the S1D13781 is VGA due to the amount of memory on the chip.  It'll do a bit more, but not 800 x 600.  It's relatively inexpensive, though.

 

Harvey

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Henning Karlsen has developed a number of graphics libraries for the Arduino environment.

 

Just recently his site changed to Rinky Dinky Electronics       http://www.rinkydinkelectronics....

 

It might be of interest to some.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Cliff

thanks. I've found a few bits and pieces online but as you say, memory is the problem.

 

@KitCarlson

thanks. I'm a licensed CVAVR user so have access to the libraries. The problem is that they are all low-level drivers. I'll still have to write the "middleware".

 

@avra

I've downloaded VisualTFT and had a play. You can in fact run on custom hardware. The problem is that the outputted source is targetted at MikroC which might be a problem to convert.

 

@awneil

If I had the budget I'd love to go the Segger route or even EasyGUI but as, even though this will (hopefully) end up as a commercial product, this is going to be self-funded 1500euro is a lot to justify.

 

@awneil

I've used intelligent display before but they are expensive compared to £35 for a 800x480 display with capacitive touchscreen from China.

 

@Cliff

thanks for the link to uGFX. Time to explore.

 

 

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There seem to be a number of posts about u8glib lately:

 

https://code.google.com/p/u8glib/

 

(dunno whether the number of posts indicates that it is "popular" and useful, or that it is tricky to use...)

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...