UART access via GUI

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

I've interfaced Atmega128 to laptop via USB to serial converter. UART communication is working successfully with whatever character I type in Hyperterminal being received to controller.
Now, I want to add GUI instead of Hyperterminal. For example, if I press "Forward" button on the GUI window, some character would be sent to Atmega128 via UART.

Currently, I'm learning JAVA for to create GUI. I'm C friendly user.
Is there any other way to do this project?

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

What operating system? Windows? GNU&Linux? Mac? Or do you want something that is cross-platform?

We've had several previous discussions on GUI apps for Windows. There are a lot of alternatives:

- C# (or VB.NET) app using e.g. Windows Forms for GUI functionality. (As an alternative to Forms there is also WPF - Windows Presentation Foundation, a much more complex and capable "framework".) Development enivronment:Visual Studio Express Edition.

- "Pelles C" has provisions for creating Windows GUIs, but I've never used that. Prominent people here say that it's easy, but that might be because of their previous experience, knowledge and insight.

- C++ and MFC (Microsoft Foundation Classes). An oldie - been around since circa 1995. MFC os a C++ "overcoat" on the C Windows API.

- C or C++ and Windows API. Even older.

- Java (with your favourite development environment, e.g. Eclipse, NetBeans...). Been a few years since I did this, but be sure to investigate early how you interface with the serial port from Java. Might have become better, but back then it was a small PITA to find out. Also several different GUI "frameworks" (Swing, SWT, AWT, SwingX, JGoodies, JavaFX, Apache Pivot...) and it has varied which one has been the leader of the pack at different times. You need to evaluate which one to use, since changing later will be a pain..

My recommendation would be C# and Windows Forms, unless you need cross platform capabilities.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Sorry for goofing up...
I want GUI for Windows OS.
Thanks for listing the various options. Will consider between Java or C#.

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

Even Hyperterminal, though it's one of the worst pieces of software on earth, can do VT52 terminal emulation so the AVR can present quite a presentable "ncurses" (google it!) style interface in VT52 terminal emulation using ANSI escapes.

(and if none of that makes any sense to you google all the technical terms I used)

Oh and to give you an idea the following are all UI's done using ncurses:

Perhaps think of it as "poor man's Windows" ;-)

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

clawson wrote:
... the AVR can present quite a presentable "ncurses" (google it!) style interface in VT52 terminal emulation using ANSI escapes.

But note that means that all the GUI work is done on & by the AVR.

JohanEkdahl's suggestions all do the GUI work on the PC - and can just send simple commands to the AVR.

Each approach, of course, has its own pros & cons.

In addition to JohanEkdahl's suggestions, there are many cross-platform GUI frameworks; eg, http://www.wxwidgets.org/ - I've used that with Python & wxGlade: http://wxglade.sourceforge.net/

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

Quote:

all the GUI work is done on & by the AVR.

True enough but the upside is that it will work with any PC/OS that has an ANSI terminal emulation (so pretty much everything). No worries about writing C# that then cannot be used on Linux/Mac and things like that. Java is supposed to be the great solution to such issues but is not necessarily all it is cracked up to be ;-)

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

clawson wrote:
will work with any PC/OS that has an ANSI terminal emulation

Or even with an actual ANSI terminal...

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

TVI 912/920/925 are my terminal of choice:

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

There is a free Basic4Java compiler from AnyWhere Software. It is much easier to use than Java. There are many useful libraries. it also sets you in the direction to use Basic4Android, so when you tire of the PC you can easily go mobile and Bluetooth.

It all starts with a mental vision.

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

[nostalgic sobbing]A genuine VT100!...[/nostalgic sobbing]

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

So...

I have been playing around with .NET Windows Forms again after not having used it for a while. When I was content with that I thought I'd have a look at what Java can do these days. (Historically, Java IDEs (Eclipse, NetBeans) have been lacking a free noob-proof "GUI dialogue editor". You either had to pay for one, or be tormented with the details of layout editors and the nitty-gritty of either SWT, Swing or ADT.

(With my not so impressing experience) I have for a long time preferred NetBeans rather than Eclipse. I'm sure the latter is good, but it's complexity just overwhelms me.

Last time I played with Java NetBeans was at 7.3. Much water under the bridges since then.. So I had a look at NetBeans 8, and it comes with "GUI Builder" (formerly called "Matisse"). I took it for a very quick spin. It comes with a few GUI examples, and I tested one of them. In less than five minutes I had established a "handler" for a button event and had a breakpoint in it so that I could see that it was activated when I clicked the button. Worked like a charm.

Also, I did a bit of Googling the other night and it seems Java now have intrinsic support for serial ports. I did reading only, but it looks promising, and I might make some tests..

Side note: The NetBeans footprint is roughly 360 MB so it's not a big thing to install it and try it out. I picked the Java SE edition. (And if you want to you can then also download the C/C++ plugin to have a nice IDE to test out C/C++ stuff!)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

With Mono/Xamarin and the Portable Class Libraries, C# is no longer limited to just Windows - now runs on Linux/Android/IOS