Programming language selection for project

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

I know here are the many experience person's having many year's of experience in embedded programming. I want to know how do you choose language for your project. When do you think you should write program in C or C++ or java or Python for example If you wrote program in C ++, then any reason why did not use C, java or python ?

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

Did you have a look at this forum before posting your question? Maybe that would've answered it. Can AVRs run Java or Python? Nope, so they're off the list. C/C++ yes. 

 

As to what language - depends on what level of embedded system we're talking about. This can range from a single chip micro with 1k of code space and 64 bytes of ram up to a multi-core cpu with gigabytes of ram. One size does not fit all. Clearly at the lower end, there's no hope of fitting a Java runtime or a python interpreter. In fact you might even be pushing your luck using C.

 

 

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

Also depends a lot on what you already know.

 

Some people here use (a version of) BASIC

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

A bit like speaking/writing English people tend to choose whatever language they feel most comfortable with (always assuming a dialect of it is available for the micro they want to program). While there are a few esoteric exceptions (Forth, Ada etc) for AVR micros the choice is basically Asm, C, Basic or C++. So pick your favourite.

 

On PCs, where there are more language choices available the choice of language may be more about what is "best for the job". Python tends to be applied to a different kind of job to C/C++. Between C or C++ your choice is often dictated by what you want to do. It's actually quite difficult to program something like Windows in C so that would tend to need to be C++, while if you were writing code for the Linux kernel you would likely have to use C.

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

sky33 wrote:
I want to know how do you choose language for your project. 
Usually the same toolchain as-is to build the RTOS or framework that has been selected for the project.

edit :

An OS in a Can | The Ganssle Group

 

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

Last Edited: Mon. Mar 30, 2020 - 03:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Can AVRs run Java or Python?
mega1284 is a popular AVR :

mega2560 :

https://github.com/slavaza/micropython-avr8/blob/master/ports/avr8-dummy/Makefile#L22

due to Python for the 8bit AVR mocrocontroller · Issue #3699 · micropython/micropython · GitHub

though XMEGA A1U has the 16MB data space (EBI is SRAM/MRAM/F-RAM and/or SDRAM) with XMEGA384 as a possible (32KB local SRAM)

AVR128DA is an XMEGA computer architecture with 16KB local RAM :

What are the AVR28DA128 AVR32DA128 AVR48DA128 AVR64DA128 ?? | AVR Freaks

though the bytecode may be swapping from SPI-attached mass storage or flash/F-RAM/MRAM.

 

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

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

clawson wrote:
While there are a few esoteric exceptions (Forth, Ada etc) for AVR micros ...
another is Pascal

AVR - Free Pascal wiki

E-LAB Computers Pascal-scm for Atmel AVR

IIRC, Pascal was the primary computer language for computer science curricula in the 80s; today, may be Python though the radio ads (Google) here are for web programming (JavaScript and related, maybe Scala)

 


I didn't know you could get Ada for AVR | AVR Freaks

GitHub - RREE/build-avr-ada-toolchain: Scripts for Building the AVR-Ada Toolchain due to AVR-Ada / [Avr-ada-devel] New repository for scripts that build the AVR-Ada toolchain

 

AVR | Platforms | GNAT Pro Safety-Critical | AdaCore though that derived of FSF AVR GCC Ada may not include XMEGA

edit : a match for avionics and LEO :

 

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

Last Edited: Mon. Mar 30, 2020 - 03:53 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As I say, "esoteric". I don't think anyone in all seriousness really programs AVRs in any of Ada, Forth, Pascal, Python, Java. They are all "fun toys" and interesting intellectual experiments to show what's technically possible but not very practical for "real world" work!

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

concur on esoteric

GNAT Pro available for 8-bit AVR Microcontroller - AdaCore

...

San Jose, Calif. and Paris, March 31, 2009 - Embedded Systems Conference - 

...

[second paragraph]

 

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