Micro Python: Python for microcontrollers

ponder

Honorary Master
Joined
Jan 22, 2005
Messages
98,690
Reaction score
31,360
Location
Niflheimr
http://www.kickstarter.com/projects/214379695/micro-python-python-for-microcontrollers

What is Micro Python?

Micro Python is a lean and fast implementation of the Python programming language (python.org) that is optimised to run on a microcontroller. The Micro Python board is a small electronic circuit board that runs the Micro Python language. The aim of this Kickstarter campaign is to make Micro Python open source software so you can use it in your own projects, and also to fund a small manufacturing run of Micro Python boards so that you can own one for yourself!

Python is a scripting language that is very easy to learn, yet highly expressive and very powerful, and has a huge existing community. Running on a small microcontroller, Micro Python allows you to effortlessly blink LEDs, read voltages, make motors and servos move, play sounds, write data to SD cards, communicate wirelessly, and be the brains of your robot, among countless other things. It is the perfect choice to control your next project!

When building an electronics project, like an intruder detector or a smart robot, a microcontroller is used as the "brain", and does all the decision making and control. There are two kinds of things that a microcontroller typically needs to do. It must do low-level control of lights, LCD displays, motors, etc, as well as high-level tasks such as reading and writing data and images, communicating wirelessly, and being an artificial intelligence. Micro Python allows you to do both low-level and high-level control, by augmenting the Python language with inline assembler and native types, as described below.
 
Good catch lad! I've also mentioned this on an earlier post. I've also seen a similar post from the python web site - which I cannot seem to find right now. Google: Electrical Engineering Python and the site might come up. Now I know why they cover Python in Electrical Engineering at Unisa. Hopefully it will make those, who are against Python realize the true capabilities of the language
 
Last edited:
Never really programmed anything except in assembler but a quick browse leads me to believe this micro-python is really simple to program in for microcontrollers.
 
Oh dear....
The bloatware crowd now targeting microcontrollers.

In this regard I have experience... used a product that ran python... the result was very disappointing.
Can't beat vanilla C for embedded applications.

But yes, I can see why this is happening. To allow all the school trained programmers, who don't even know what it means to toggle a bit, to code for embedded. Usually huge programs doing very little and then they bitch and moan the thing is so slow.

Fortunately they will all remain in the arduino playground, the real mean will make money and design efficient systems that run normal C code that everyone can understand (assuming people were taught properly in the first place)
 
Oh dear....
The bloatware crowd now targeting microcontrollers.

In this regard I have experience... used a product that ran python... the result was very disappointing.
Can't beat vanilla C for embedded applications.

But yes, I can see why this is happening. To allow all the school trained programmers, who don't even know what it means to toggle a bit, to code for embedded. Usually huge programs doing very little and then they bitch and moan the thing is so slow.

Fortunately they will all remain in the arduino playground, the real mean will make money and design efficient systems that run normal C code that everyone can understand (assuming people were taught properly in the first place)

+1000000

I absolutely agree with you. Why would you want to take shortcuts and use python of all languages? As an avid embedded programmer, I strongly appose the use of high level languages in embedded design. Pointless not using Assembly or C, make one appreciate the work more.
 
embedded programming. sounds like a **** way to make money if all you can do is use C and Assembler. I say the C and Assembler embedded programmers are the amateurs. you should be using Machine code and etching your own circuits.
 
embedded programming. sounds like a **** way to make money if all you can do is use C and Assembler. I say the C and Assembler embedded programmers are the amateurs. you should be using Machine code and etching your own circuits.

Assembler is practically machine code for the particular CPU's instruction set.
 
:confused: I thought I was going to see a small snake in this thread... Oh well..
 
+1000000

I absolutely agree with you. Why would you want to take shortcuts and use python of all languages? As an avid embedded programmer, I strongly appose the use of high level languages in embedded design. Pointless not using Assembly or C, make one appreciate the work more.

Do you also oppose the use of Java and C# in desktop applications? It's really the same.

While you can get on your high horse and say how much better x is than Y, you need to remember that when writing code for money, good code is code that works and takes the shortest amount of time to write.

If you're designing weapon systems then yeah, you're going to need to use low level stuff, but what if you're just making some servos move around or need an alarm to beep when movement is detected? Using Arduino wiring or even .NET is going to be so close performance-wise that it'll be impossible to tell which you've done in Assembly (well, besides the fact that you might still be busy writing the assembly one :P).
 
The internet of things ... you can have a complete router firmware in 4MB ROM but that needs to be programmed in C (and in-line asm) and takes many, many man hours - but when you want to do simple home automation you don't need high performance and tight code. With Python a kid can write a program to detect a bluetooth phone that comes into range, authenticates as a valid device and drives a relay to open the garage door.

I saw that(?) example in Linux user and Developer magazine and it was quite succint. It could be easily understood and modified. Non engineers can create interesting devices without spending many hours learning a high performance language. You trade performance, man-hours, silicon cost (and other factors) against volume and I can understand why Python. You want to sell a 10K-1M+ of routers, you go C.
 
+1000000

I absolutely agree with you. Why would you want to take shortcuts and use python of all languages? As an avid embedded programmer, I strongly appose the use of high level languages in embedded design. Pointless not using Assembly or C, make one appreciate the work more.

Take it you don't realize the power and portability of python then?
 
Oh dear....
The bloatware crowd now targeting microcontrollers.

In this regard I have experience... used a product that ran python... the result was very disappointing.
Can't beat vanilla C for embedded applications.

But yes, I can see why this is happening. To allow all the school trained programmers, who don't even know what it means to toggle a bit, to code for embedded. Usually huge programs doing very little and then they bitch and moan the thing is so slow.

Fortunately they will all remain in the arduino playground, the real mean will make money and design efficient systems that run normal C code that everyone can understand (assuming people were taught properly in the first place)

You do not realize the potential of Python. Try googling about Python in embedded systems and come back with a reply. I will recommend a couple of sites when I have the time. But you sound as if you have engineered a controller from scratch with a Python environment. If you have please explain what you found frustrating
 
The internet of things ... you can have a complete router firmware in 4MB ROM but that needs to be programmed in C (and in-line asm) and takes many, many man hours - but when you want to do simple home automation you don't need high performance and tight code. With Python a kid can write a program to detect a bluetooth phone that comes into range, authenticates as a valid device and drives a relay to open the garage door.

I saw that(?) example in Linux user and Developer magazine and it was quite succint. It could be easily understood and modified. Non engineers can create interesting devices without spending many hours learning a high performance language. You trade performance, man-hours, silicon cost (and other factors) against volume and I can understand why Python. You want to sell a 10K-1M+ of routers, you go C.


That's what I love about this, a person who isn't an Einstein in programming OR a non-engineer can still be innovative. Small-scale controllers can be built extending to large-scale. Python also has good A.I capabilities, making it a language worth considering. It doesn't matter, if you have never done Computer Science, Engineering, I.T you will not be deprived. Micro-python is still in development. I have a strong feeling that micro-python WILL DROP JAWS! (I'm not shouting, just emphasis)
 
I dislike python on embedded systems from when I was playing around with a few cellphone modules that used it. That being said I totally agree with some of the comments here in that:

If you are just tinkering to get something together, python is likely to be a lot more helpful than learning C. There will be a bunch of open source projects and DIY programs that this python could serve a LOT better than C.

If you are going into production for a project and you need to save on instruction cycles (allowing more to be done on a smaller micro, saving battery and chip size for the same task etc), then you're going to be better served on C.

The point is there's a space for both. I'm astounded when people see something and knock it immediately because they think it has been designed to replace what they are using... when it hasn't.

It's just another tool in the belt.
 
Top
Sign up to the MyBroadband newsletter
X