Author Topic: Your go-to language/dev enviroment for MCU - PC host software  (Read 4224 times)

0 Members and 1 Guest are viewing this topic.

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1610
  • Country: gb
I'm sure this question has been asked many times, often vaguely with 'what PC language do you use?' but I will try to make this more specific.

A long time ago when I found out how cool it is to be able to hook an MCU to a PC (back then it was mostly serial, but quickly became USB, ethernet, now WIFI, or bluetooth) I started making windows apps in... VB6, then VB.NET, then realised how gastly VB is, switched to C# but still using .NET most of the time.  After years of reading hackaday articles, and reading posts on here it seems we are spoiled for choice in terms of what language we use for the 'PC host side'.  Be it for full compiled apps using .NET/C# or scripted languages, python, java, processing etc..  safe to say I have very little experience in the latter examples.

So, for jobs where you've made your MCU-based hardware... say.. for sensors or human interface etc.. what did you use for the PC host software?  And do you still use good 'ol serial (be it RS232, USB-serial adapters, or RS-485) or is it more common to choose USB (HID class rather than CDC?) or Ethernet, for remote systems.

I constantly feel like I'm 'missing out' by not knocking up python scripts or java applets when I need a bit of bespoke software for my own projects, even though I can probably get a half decent GUI quick 'app' knocked up in visual studio using .NET in a few hours. - an example of that would be a small app that imports a *.wav file and sends it to a AVR MCU via serial port to load in a flash chip for playback.

I'm sure there is 'better' (as in faster, neater, easier?) way to make such applications and also it would be good for me to learn some scripting languages (mostly java .. but python seems very popular too).  But I'm asking if people on the forum actually use these.   I have always wanted to add 'data visualization' to applications (graphs, dials etc..) but being locked into .NET's tools I think is stifling. So what are the common languages and tools you use?
« Last Edit: April 11, 2017, 04:34:12 pm by Buriedcode »
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2582
  • Country: us
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #1 on: April 11, 2017, 05:06:49 pm »
I've been thinking about this recently as well.  I've done a bit of python, which has of course a lot of available extensions including several GUI toolkits.  I've used matplotlib to do some basic trend plots and that works fairly well, although implementing user interaction with the graphs (pan, zoom, etc) seems to be a bit cumbersome. 

One option that's caught my eye is Electron.  I'm sure people will respond with how it's automatically terrible for being all web-derived, but the possibility of leveraging the layout and styling power of HTML/CSS and the rich user interaction capabilities of javascript (including many of the popular JS frameworks) for cross-platform desktop applications is pretty appealing.  Apparently there is support for accessing serial ports from within Electron, but I haven't investigated that or any other connectivity facilities yet.  I assume it's possible to tie into backend stuff written in other languages where necessary.
 
The following users thanked this post: ebclr

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1272
  • Country: gb
    • bitdynamics
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #2 on: April 11, 2017, 06:16:30 pm »
It's an interesting question and one i also would be fascinated by the answer (which i suspect will not be straight forward, as there are so many options to choose from!)

I am spoiled because at work, i use a tool chain that costs thousands, and it means i can design a model in Mathworks Simulink, auto code it to the target controller, then flash and calibrate that target using ETAS INCA over CCP/XCP etc.  As a tool chain, that's a multi thousand £££ capability.

What i'd love is a simpler, hobby version, with a robust software front end, that loads standard target descriptor files (probably .xml format) and enables relatively seamless system optimisation without rewriting the code every time!
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #3 on: April 11, 2017, 06:55:54 pm »
I am more than willing the use VB for the host side regardless of the type of communications.  Serial, HID, Ethernet, doesn't matter.
Lately I have been playing with C# but I haven't done anything on the outside.  I suspect it will work fine.  I did play around with Microsoft's IoT platform for a while but I don't have an application.  All my toaster needs to do is make toast.  I don't expect it to display Headline News.
 My watch does that...  No it doesn't!

Interesting project:  Add knobs, switches and dials to Microsoft Flight Simulator using an AVR on the sensor/display end with HID transmission to a bit of C code connecting to a library provided by Microsoft.  If I were more interested, I would build a full function cockpit for the F106.  At the time, I didn't have room.  Now I have a 4 car garage and the cars stay outside so it would be possible.  Hm...
« Last Edit: April 11, 2017, 07:03:41 pm by rstofer »
 

Offline sanwal209

  • Regular Contributor
  • *
  • Posts: 114
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #4 on: April 11, 2017, 06:58:09 pm »
From last 10 years I have used different softwares to design GUI. I did start from VB6. Best choice would be either .net or Labview. In Python you need to make gui by coding int text and trust me its so much time consuming. Debugging is 75% guess work, 25% magic powers. For me its the matter of time. Try making a simple uart string dump from python and you will get the idea.
 

Offline krho

  • Regular Contributor
  • *
  • Posts: 222
  • Country: si
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #5 on: April 11, 2017, 07:18:21 pm »
One option that's caught my eye is Electron.  I'm sure people will respond with how it's automatically terrible for being all web-derived

It is terrible just see what a memory/CPU hog Slack desktop app that uses it is.

You can also look at Lazarus if you are more in Deliphi/Pascal watters
 

Offline ^_^

  • Regular Contributor
  • *
  • Posts: 82
  • Country: au
  • EE
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #6 on: April 11, 2017, 09:31:32 pm »
I remember I had to write PC-side UART receiver once, that would work at 3.5 Mbps. I have chosen Visual Studio C# for that and it's serialport control.
It worked and it would even display the data in chart control in real time as well as log the data into a file. The app was multi-threaded and the chart thread as well as receiver thread would sit at 100% core load (which was 50% overall at 4-core PC I was using).

The point is, if you need something simple, then high-abstract stuff like you mentioned (Python, Java) is probably the way to go.
But... if you need performance, then C# or C++ are still irreplaceable.
IMHO.
 ;D
 

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1610
  • Country: gb
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #7 on: April 11, 2017, 09:47:34 pm »
So it seems that many still use .NET and create stand alone applications.  I'm surprised, and kind of relieved as I thought I was completely behind.  Also surprised that people still use the serial port, although not that much as the few 'industry' people I know regularly do serial port stuff.

I guess I asked because I was looking to finally get to grips with Java, python, and possibly other languages and as I'm very much an electronics guy - looking for example projects where people had created PC-side apps as part of it.  Also.. does anyone use processing?  I've used it a couple of times to visualize the waveform for an optical pulse sensor but never in earnest. 
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #8 on: April 11, 2017, 10:05:22 pm »
Usually the language is the least important consideration.

Far more important are the libraries for  GUI and/or processing, libraries for comms, compatibility with deployment considerations, and familiarity with the development environment.

Having said that, some languages enable you to concentrate more on solving your problem, other make you concentrate too much on solving the language and implementation problems.
« Last Edit: April 12, 2017, 07:17:23 am by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #9 on: April 11, 2017, 10:12:17 pm »
Radstudio is a very power option

Pro's cross-platform , easy to use, lot of legacy

Cons's

Price
 

Offline lem_ix

  • Regular Contributor
  • *
  • Posts: 192
  • Country: cs
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #10 on: April 11, 2017, 10:23:17 pm »
Python, bloody simple  8) From not knowing it to poorly plotting data from a wireless sensor network took 2-3 days.
 

Offline danmcb

  • Regular Contributor
  • *
  • Posts: 128
  • Country: be
  • if it ain't bust, I didn't test it yet.
    • McBee Audio Labs
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #11 on: April 12, 2017, 01:03:29 am »
depends what. For a GUI app, c#/.NET. But I rarely do this. For messing with text files - perl. These days - python tends to crop up.
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #12 on: April 12, 2017, 01:46:41 am »
+1 for VB6 /.NET
Hello <tap> <tap> .. is this thing on?
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #13 on: November 22, 2017, 04:03:23 am »
Hello,
I want to bring this up just to check if there are any new opinions? I've never done any PC communication rather then LwIP with a web server, so now I struggle to find good examples for communications over USB. I just want some GUI with a button or a slider as well as indicator or something hooked up to STM32 over USB. Whether it's HID, VCP or whatever... Are there any good examples about this? Visual Studio C# or some Qt? Python maybe?
There was Borland C++ builder in the old days, but now I'd prefer something available for free. ::)
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #14 on: November 22, 2017, 01:18:51 pm »
You can try PSOC 5LP family, tool is free, Creator. has a number of USB
examples, host, client, boot, ADC.....Cypress also does a number of stand
controllers, with additional tools for design.

Also a number of videos for training.

http://www.cypress.com/site/search?keyword=usb#gsc.q=usb&gsc.tab=0&gsc.ref=more%3Avideos&gsc.sort=

A tool example attached. You GUI drag and drop components onto schematic.
Each component typically has 10's of prewritten APIs where you just make f()
calls to implement coding. The analog and digital shown is onchip.

Low end dev board ($ 10)



http://www.cypress.com/documentation/development-kitsboards/cy8ckit-059-psoc-5lp-prototyping-kit-onboard-programmer-and



Regards, Dana.
« Last Edit: November 22, 2017, 01:30:22 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 834
  • Country: gb
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #15 on: November 22, 2017, 01:48:59 pm »
Try making a simple uart string dump from python and you will get the idea.

Im working on a project where I am using serial to communicate with a PIC.

I used the pyserial library and it was very straight forward.

Unless you were trying to do something much more low level, which pyserial hides (kind of the point).
 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: de
  • Sigrok associate
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #16 on: November 22, 2017, 01:54:17 pm »
I would just like to point out that with Qt Creator / Qt Designer, there are RAD solutions available for Qt as well. There's no need to create the UI elements by hand, which of course is rather time consuming.
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #17 on: November 22, 2017, 02:02:35 pm »
Just the same toolset I use for embedded development:
Linux (or cygwin at work where I must use a windows machine), gcc, make, version control, editor of your choice.
My favourite language is still plain C, my PC-side applications usually are console I/O to the user side, and CAN, serial or TCP/IP to the embedded device side.
I stay away from USB since either the cables are too short or it just works unreliable or you're in driver hell.
No GUI, command line parameters rock  8)
If I need some graphing output, I write the data to a suitable file and place a bit of scripting around gnuplot
Another way is to feed the data into an RRD (round robin database) and use its PNG output inside a simple html page with a bit of php scripting.


Safety devices hinder evolution
 

Offline asmi

  • Super Contributor
  • ***
  • Posts: 2728
  • Country: ca
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #18 on: November 22, 2017, 02:25:23 pm »
I use mostly .NET/C# (since I use it professionally at work so it's a no-brainer), unless I need to use some kind of vendor-supplied library, in this case it's usually C/C++. Case in point - FTDI's D2XX and D3XX API libraries that work with their ICs over USB.

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #19 on: November 22, 2017, 02:28:33 pm »
We write pc-side applications in Qt.
Reasons: it runs virtually on every platform, it's fast, object oriented, very good documentation, active community and forum,
comes for free but payed support is also available and there are already a lot of widgets available to start quickly.
 

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1610
  • Country: gb
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #20 on: November 22, 2017, 03:05:23 pm »
Good to see people updating the thread!

I've just downloaded Qt, and will write a few test apps.  I've been meaning to make some bluetooth apps for my phone and tablet anyway, so this - along with using Xamarin - will be a good intro to it all.
Although I'm more of a nuts 'n'bolts guy, swanky looking graphs and controls are always appealing - I used to code them from scratch  many years ago, and they rarely looked good.

Cheers!
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #21 on: November 22, 2017, 03:33:18 pm »
Some Qt libraries with interesting widgets (free for opensource only, needs a commercial license for closed source software):

http://qwt.sourceforge.net/

http://www.qcustomplot.com/

As an example, this application is written in Qt as well: https://www.teuniz.net/DSRemote/oscilloscope_decode.png

« Last Edit: November 22, 2017, 03:40:09 pm by Karel »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #22 on: November 22, 2017, 07:33:37 pm »
If I need a 'forms' interface, it will most likely be done in VB - I'm lazy.

OTOH, when I wanted to add physical buttons, knobs and dials to Microsoft Flight Simulator, I made the gadgets report as a HID interface and used C to tie the values into the simulator.

The HID interface is pretty easy to work with but if I'm in a hurry, I'll use VCOM.  Any of the Microsoft languages can deal with a serial port.  In fact, I wrote a little shim code to support a serial port under GNU Fortran.  I don't recall why...  Maybe just because I could and I still use Fortran for numerical kinds of things.

Matlab is another possibility.  There's an Arduino toolkit that links Simulink with hardware.  Matlab can provide a very interesting dashboard for external gadgets.

As to environment, there are 3 general cases.  First, the environment provided by the device manufacturer.  Second, Microsoft Visual Studio and finally, Eclipse.  It may also turn out that the manufacturers are using Eclipse as the IDE with modifications.  All this for Windows...  For Linux, it will be Eclipse or gedit and makefiles.  I haven't done a lot of GUI stuff under Linux.

I have played with Qt and Tkinter using Python.
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Your go-to language/dev enviroment for MCU - PC host software
« Reply #23 on: November 22, 2017, 07:51:12 pm »
Ok, I don't see anyone using LabView CVI?
As for the middleware level - libusb doesn't seem to be popular as well?
For Qt people - do you have a good website for examples with embedded platforms? I've never touched Qt, so a simple example would be a good place to start.
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf