3 Replies - 4689 Views - Last Post: 01 May 2012 - 12:46 AM

#1 Faitas  Icon User is offline

  • New D.I.C Head

Reputation: 6
  • View blog
  • Posts: 44
  • Joined: 04-November 11

Microcontrollers programming with C++

Posted 30 April 2012 - 03:17 PM

Hello there,

I have been thinking about this programming... I love WEB programming and I think I don't have to forgot it, but I want to program microcontrollers for a while, for a tests, for a free-time and so on. :) So I have a one question: Is C++ very good programming language for this programming? Or I can use Python? First of all, I want to create a LED screen with a message in it.

Thank you a lot.

Is This A Good Question/Topic? 0
  • +

Replies To: Microcontrollers programming with C++

#2 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1086
  • View blog
  • Posts: 4,564
  • Joined: 09-June 09

Re: Microcontrollers programming with C++

Posted 30 April 2012 - 04:25 PM

C/C++ are good languages due to the fact that they are compiled down into machine code directly (machine codes are the instructions for the micro processor). Interpretive languages are not directly compiled down into machine code and therefore trying to get them to work on a micro processor seems to be a hack; however, there is a group (leaf labss) working on this right now:

http://leaflabs.com/2011/09/pymite/

My suggestion is to stick with either C or C++ for microprocessor programming.
Was This Post Helpful? 0
  • +
  • -

#3 ishkabible  Icon User is offline

  • spelling expret
  • member icon




Reputation: 1622
  • View blog
  • Posts: 5,709
  • Joined: 03-August 09

Re: Microcontrollers programming with C++

Posted 30 April 2012 - 04:44 PM

it's not really a hack; it's no different form doing it on a desktop you just have fewer resources so the efficiency issue matters. also, things like python and ruby tend to have large libraries that do system specific things. Lua doesn't have these things or issue and can be easily run on an embedded system. there is the issue of where you store the files for interpretation however; that part can be more tricky on embedded systems but it's not a subject of research.
Was This Post Helpful? 0
  • +
  • -

#4 turboscrew  Icon User is offline

  • D.I.C Addict

Reputation: 100
  • View blog
  • Posts: 629
  • Joined: 03-April 12

Re: Microcontrollers programming with C++

Posted 01 May 2012 - 12:46 AM

With smaller microcontrollers, I'd stick with C. Even C++ runtime may be too big.

Not all microcontrollers are 32-bit RISCs with hundreds of megs of memory.

Like atMega169: only 1 kB RAM and 32 kB of FLASH. Try to put 100MB java on it. With C you can still write a cruise control and still most of the RAM is spent for RS-buffers. Don't even dream of any operating system.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1