求知 文章 文库 Lib 视频 iPerson 课程 认证 咨询 工具 讲座 Modeler   Code  
会员   
 
  
 
 
     
   
分享到
MicroPython:针对微控制器的Python
 
作者 刘江总编 来源:CSDN  火龙果软件  发布于 2015-05-19
 

剑桥大学数学科学中心的Damien P. George在研究各种深奥数学、物理问题之余,还搞了一个MicroPython项目,将Python移植到ARM Cortex M微处理器上,并开发了电路板。2013年曾经在KickStarter上成功筹得近10万英镑。2014年成功完成项目,发货。

同时,这个项目也在GitHub上开源,至今已有1800+星,60位贡献者。

George曾在2014年PyCon UK上介绍MicroPython,所用硬件平台叫pyboard,规格是:
  • STM32F405RG: 192k RAM, 1M ROM, 168MHz, Cortex M4F.
  • USB micro connector for device (and host).
  • Micro SD card.
  • 3-axis accelerometer (MMA7660).
  • Real-time clock, 4 LEDs, 2 switches.
  • 30 GPIO: symmetric pin layout, plus extra pins.
  • Internal file system. ”/flash” and ”/sd”.

由于存储太小,CPython都太大,只能自行开发Python实现,采取了很多优化措施:
  • Interned strings, most already in ROM.
  • Small integers stuffed in a pointer.
  • Optimised method calls (thanks PyPy!).
  • Range object is optimised (if possible).
  • Python stack frames live on the C stack.
  • ROM absolutely everything that can be ROMed!
  • Garbage collection only (no reference counts).
  • Exceptions implemented with custom setjmp/longjmp.

优化后,比原生的Python 2和Python 3都快了几个数量级:https://news.ycombinator.com/item?id=7841642

MicroPython的生态系统现在也开始起来了,就在本月前几天,荷兰埃因霍温的一个团队WiPy刚刚在KickStarter上成功众筹到75000多英镑,他们的项目是基于MicroPython软件的另一款硬件:超低功耗的物联网WiFi硬件。

SparkFun上也有WiFi模块ESP8266。

HN上的两次讨论:

-https://news.ycombinator.com/item?id=9558969 -https://news.ycombinator.com/item?id=7840566






 
分享到
 
 
 
 



利用Gitlab和Jenkins做CI
CPU深度学习推理部署优化
九种跨域方式实现原理
 
 讲座 设计模式C语言
 讲师:薛卫国
 时间:2019-4-20
 
 
每天2个文档/视频
扫描微信二维码订阅
订阅技术月刊
获得每月300个技术资源
 
希望我们的资料可以帮助你学习,也欢迎投稿&提建议给我
频道编辑:winner
邮       件:winner@uml.net.cn

关于我们 | 联系我们 | 京ICP备10020922号 京公海网安备110108001071号